SlideShare uma empresa Scribd logo
1 de 2
Baixar para ler offline
Create another four objects, this time, using the new operator, one object per constructor, and on
each object call the print function.
#include
#include
using namespace std;
class Employee
{
private:
int id;
string name;
short age;
public:
Employee() : id(7700), name("Luke Skywalker"), age(29) {}
Employee(int emp_id) : id(emp_id), name("Indiana Jones"), age(80) {}
Employee(int emp_id, string emp_name) : id(emp_id), name(emp_name), age(29) {}
Employee(int emp_id, string emp_name, short emp_age) : id(emp_id), name(emp_name),
age(emp_age) {}
void print()
{
cout << "Employee ID: " << id << endl;
cout << "Name: " << name << endl;
cout << "Age: " << age << endl;
}
};
int main()
{
Employee emp1;
emp1.print();
Employee emp2(99134);
emp2.print();
Employee emp3(7700, "Steven Bradshaw");
emp3.print();
Employee emp4(2187, "Mike Tyson", 56);
emp4.print();
return 0;
}
OUTPUT:
Employee ID: 7700
Name: Luke Skywalker
Age: 29
Employee ID: 99134
Name: Indiana Jones
Age: 80
Employee ID: 7700
Name: Steven Bradshaw
Age: 29
Employee ID: 2187
Name: Mike Tyson
Age: 56

Mais conteúdo relacionado

Semelhante a Create another four objects, this time, using the new operator, one .pdf

TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionHans Höchtl
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6Nitay Neeman
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfrajkumarm401
 
This code has nine errors- but I don't know how to solve it- Please gi (1).pdf
This code has nine errors- but I don't know how to solve it- Please gi (1).pdfThis code has nine errors- but I don't know how to solve it- Please gi (1).pdf
This code has nine errors- but I don't know how to solve it- Please gi (1).pdfaamousnowov
 
JavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScriptJavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScriptLaurence Svekis ✔
 
Madrid gug - sacando partido a las transformaciones ast de groovy
Madrid gug - sacando partido a las transformaciones ast de groovyMadrid gug - sacando partido a las transformaciones ast de groovy
Madrid gug - sacando partido a las transformaciones ast de groovyIván López Martín
 
Hi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdfHi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdffashioncollection2
 
Mongoose getting started-Mongo Db with Node js
Mongoose getting started-Mongo Db with Node jsMongoose getting started-Mongo Db with Node js
Mongoose getting started-Mongo Db with Node jsPallavi Srivastava
 
Game Design and Development Workshop Day 1
Game Design and Development Workshop Day 1Game Design and Development Workshop Day 1
Game Design and Development Workshop Day 1Troy Miles
 
G3 Summit 2016 - Taking Advantage of Groovy Annotations
G3 Summit 2016 - Taking Advantage of Groovy AnnotationsG3 Summit 2016 - Taking Advantage of Groovy Annotations
G3 Summit 2016 - Taking Advantage of Groovy AnnotationsIván López Martín
 
The purpose of this C++ programming project is to allow the student .pdf
The purpose of this C++ programming project is to allow the student .pdfThe purpose of this C++ programming project is to allow the student .pdf
The purpose of this C++ programming project is to allow the student .pdfRahul04August
 
C++ Course - Lesson 3
C++ Course - Lesson 3C++ Course - Lesson 3
C++ Course - Lesson 3Mohamed Ahmed
 

Semelhante a Create another four objects, this time, using the new operator, one .pdf (14)

TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Graphql, REST and Apollo
Graphql, REST and ApolloGraphql, REST and Apollo
Graphql, REST and Apollo
 
Getting started with ES6
Getting started with ES6Getting started with ES6
Getting started with ES6
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdf
 
This code has nine errors- but I don't know how to solve it- Please gi (1).pdf
This code has nine errors- but I don't know how to solve it- Please gi (1).pdfThis code has nine errors- but I don't know how to solve it- Please gi (1).pdf
This code has nine errors- but I don't know how to solve it- Please gi (1).pdf
 
JavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScriptJavaScript Objects and OOP Programming with JavaScript
JavaScript Objects and OOP Programming with JavaScript
 
Madrid gug - sacando partido a las transformaciones ast de groovy
Madrid gug - sacando partido a las transformaciones ast de groovyMadrid gug - sacando partido a las transformaciones ast de groovy
Madrid gug - sacando partido a las transformaciones ast de groovy
 
Hi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdfHi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdf
 
Mongoose getting started-Mongo Db with Node js
Mongoose getting started-Mongo Db with Node jsMongoose getting started-Mongo Db with Node js
Mongoose getting started-Mongo Db with Node js
 
Game Design and Development Workshop Day 1
Game Design and Development Workshop Day 1Game Design and Development Workshop Day 1
Game Design and Development Workshop Day 1
 
java
javajava
java
 
G3 Summit 2016 - Taking Advantage of Groovy Annotations
G3 Summit 2016 - Taking Advantage of Groovy AnnotationsG3 Summit 2016 - Taking Advantage of Groovy Annotations
G3 Summit 2016 - Taking Advantage of Groovy Annotations
 
The purpose of this C++ programming project is to allow the student .pdf
The purpose of this C++ programming project is to allow the student .pdfThe purpose of this C++ programming project is to allow the student .pdf
The purpose of this C++ programming project is to allow the student .pdf
 
C++ Course - Lesson 3
C++ Course - Lesson 3C++ Course - Lesson 3
C++ Course - Lesson 3
 

Mais de info48697

Define the terms adulteration and misbranding How are these concept.pdf
Define the terms adulteration and misbranding How are these concept.pdfDefine the terms adulteration and misbranding How are these concept.pdf
Define the terms adulteration and misbranding How are these concept.pdfinfo48697
 
Define medical futility. Does the definition of futility change with.pdf
Define medical futility. Does the definition of futility change with.pdfDefine medical futility. Does the definition of futility change with.pdf
Define medical futility. Does the definition of futility change with.pdfinfo48697
 
Define or explain CHAPTER 7 � Types of Tangible and Intan.pdf
Define or explain CHAPTER 7 � Types of Tangible and Intan.pdfDefine or explain CHAPTER 7 � Types of Tangible and Intan.pdf
Define or explain CHAPTER 7 � Types of Tangible and Intan.pdfinfo48697
 
Define and explain social entrepreneurship Describe the corporate pu.pdf
Define and explain social entrepreneurship Describe the corporate pu.pdfDefine and explain social entrepreneurship Describe the corporate pu.pdf
Define and explain social entrepreneurship Describe the corporate pu.pdfinfo48697
 
Define divisors(x) as {y Z y x}. Let a and b be two integers. Pr.pdf
Define divisors(x) as {y  Z y  x}. Let a and b be two integers. Pr.pdfDefine divisors(x) as {y  Z y  x}. Let a and b be two integers. Pr.pdf
Define divisors(x) as {y Z y x}. Let a and b be two integers. Pr.pdfinfo48697
 
Define artificial intelligence. What does it mean to say that artifi.pdf
Define artificial intelligence. What does it mean to say that artifi.pdfDefine artificial intelligence. What does it mean to say that artifi.pdf
Define artificial intelligence. What does it mean to say that artifi.pdfinfo48697
 
Cualquier resultado, resultado o elemento medible, tangible y verifi.pdf
Cualquier resultado, resultado o elemento medible, tangible y verifi.pdfCualquier resultado, resultado o elemento medible, tangible y verifi.pdf
Cualquier resultado, resultado o elemento medible, tangible y verifi.pdfinfo48697
 
Daniel, Steven ve Chris CTde m�hendis olarak �almaktadr. irketlerin.pdf
Daniel, Steven ve Chris CTde m�hendis olarak �almaktadr. irketlerin.pdfDaniel, Steven ve Chris CTde m�hendis olarak �almaktadr. irketlerin.pdf
Daniel, Steven ve Chris CTde m�hendis olarak �almaktadr. irketlerin.pdfinfo48697
 
Cuando un auditor descubre m�s de una condici�n que requiere la desv.pdf
Cuando un auditor descubre m�s de una condici�n que requiere la desv.pdfCuando un auditor descubre m�s de una condici�n que requiere la desv.pdf
Cuando un auditor descubre m�s de una condici�n que requiere la desv.pdfinfo48697
 
De cara al futuro, creo que la importancia subyacente de la educaci�.pdf
De cara al futuro, creo que la importancia subyacente de la educaci�.pdfDe cara al futuro, creo que la importancia subyacente de la educaci�.pdf
De cara al futuro, creo que la importancia subyacente de la educaci�.pdfinfo48697
 
david and liam have entered into a limited partnership where david i.pdf
david and liam have entered into a limited partnership where david i.pdfdavid and liam have entered into a limited partnership where david i.pdf
david and liam have entered into a limited partnership where david i.pdfinfo48697
 
Dave borrowed $1,150 on January 1, 2022. The bank charged him a $4.5.pdf
Dave borrowed $1,150 on January 1, 2022. The bank charged him a $4.5.pdfDave borrowed $1,150 on January 1, 2022. The bank charged him a $4.5.pdf
Dave borrowed $1,150 on January 1, 2022. The bank charged him a $4.5.pdfinfo48697
 
Data Security Read the article below and answer the following questi.pdf
Data Security Read the article below and answer the following questi.pdfData Security Read the article below and answer the following questi.pdf
Data Security Read the article below and answer the following questi.pdfinfo48697
 
Daniel Browning Smith has been named the most flexible man alive. Sm.pdf
Daniel Browning Smith has been named the most flexible man alive. Sm.pdfDaniel Browning Smith has been named the most flexible man alive. Sm.pdf
Daniel Browning Smith has been named the most flexible man alive. Sm.pdfinfo48697
 
d. What is the total value of the company as of year 0 e. What is.pdf
d. What is the total value of the company as of year 0 e. What is.pdfd. What is the total value of the company as of year 0 e. What is.pdf
d. What is the total value of the company as of year 0 e. What is.pdfinfo48697
 
D) good genes ^^^ Which of the following isare example(s) of as.pdf
D) good genes ^^^ Which of the following isare example(s) of as.pdfD) good genes ^^^ Which of the following isare example(s) of as.pdf
D) good genes ^^^ Which of the following isare example(s) of as.pdfinfo48697
 
Donita Murphy is a primary care physician at a local community pract.pdf
Donita Murphy is a primary care physician at a local community pract.pdfDonita Murphy is a primary care physician at a local community pract.pdf
Donita Murphy is a primary care physician at a local community pract.pdfinfo48697
 
Dolphin Co., 2017 ylnda 1.500 $ �cret ald ve bunun 13� 2018de kaz.pdf
Dolphin Co., 2017 ylnda 1.500 $ �cret ald ve bunun 13� 2018de kaz.pdfDolphin Co., 2017 ylnda 1.500 $ �cret ald ve bunun 13� 2018de kaz.pdf
Dolphin Co., 2017 ylnda 1.500 $ �cret ald ve bunun 13� 2018de kaz.pdfinfo48697
 
Do you agree with how countries in this part of the world have been .pdf
Do you agree with how countries in this part of the world have been .pdfDo you agree with how countries in this part of the world have been .pdf
Do you agree with how countries in this part of the world have been .pdfinfo48697
 
DO NOT use System.exit().DO NOT add the project or package stateme.pdf
DO NOT use System.exit().DO NOT add the project or package stateme.pdfDO NOT use System.exit().DO NOT add the project or package stateme.pdf
DO NOT use System.exit().DO NOT add the project or package stateme.pdfinfo48697
 

Mais de info48697 (20)

Define the terms adulteration and misbranding How are these concept.pdf
Define the terms adulteration and misbranding How are these concept.pdfDefine the terms adulteration and misbranding How are these concept.pdf
Define the terms adulteration and misbranding How are these concept.pdf
 
Define medical futility. Does the definition of futility change with.pdf
Define medical futility. Does the definition of futility change with.pdfDefine medical futility. Does the definition of futility change with.pdf
Define medical futility. Does the definition of futility change with.pdf
 
Define or explain CHAPTER 7 � Types of Tangible and Intan.pdf
Define or explain CHAPTER 7 � Types of Tangible and Intan.pdfDefine or explain CHAPTER 7 � Types of Tangible and Intan.pdf
Define or explain CHAPTER 7 � Types of Tangible and Intan.pdf
 
Define and explain social entrepreneurship Describe the corporate pu.pdf
Define and explain social entrepreneurship Describe the corporate pu.pdfDefine and explain social entrepreneurship Describe the corporate pu.pdf
Define and explain social entrepreneurship Describe the corporate pu.pdf
 
Define divisors(x) as {y Z y x}. Let a and b be two integers. Pr.pdf
Define divisors(x) as {y  Z y  x}. Let a and b be two integers. Pr.pdfDefine divisors(x) as {y  Z y  x}. Let a and b be two integers. Pr.pdf
Define divisors(x) as {y Z y x}. Let a and b be two integers. Pr.pdf
 
Define artificial intelligence. What does it mean to say that artifi.pdf
Define artificial intelligence. What does it mean to say that artifi.pdfDefine artificial intelligence. What does it mean to say that artifi.pdf
Define artificial intelligence. What does it mean to say that artifi.pdf
 
Cualquier resultado, resultado o elemento medible, tangible y verifi.pdf
Cualquier resultado, resultado o elemento medible, tangible y verifi.pdfCualquier resultado, resultado o elemento medible, tangible y verifi.pdf
Cualquier resultado, resultado o elemento medible, tangible y verifi.pdf
 
Daniel, Steven ve Chris CTde m�hendis olarak �almaktadr. irketlerin.pdf
Daniel, Steven ve Chris CTde m�hendis olarak �almaktadr. irketlerin.pdfDaniel, Steven ve Chris CTde m�hendis olarak �almaktadr. irketlerin.pdf
Daniel, Steven ve Chris CTde m�hendis olarak �almaktadr. irketlerin.pdf
 
Cuando un auditor descubre m�s de una condici�n que requiere la desv.pdf
Cuando un auditor descubre m�s de una condici�n que requiere la desv.pdfCuando un auditor descubre m�s de una condici�n que requiere la desv.pdf
Cuando un auditor descubre m�s de una condici�n que requiere la desv.pdf
 
De cara al futuro, creo que la importancia subyacente de la educaci�.pdf
De cara al futuro, creo que la importancia subyacente de la educaci�.pdfDe cara al futuro, creo que la importancia subyacente de la educaci�.pdf
De cara al futuro, creo que la importancia subyacente de la educaci�.pdf
 
david and liam have entered into a limited partnership where david i.pdf
david and liam have entered into a limited partnership where david i.pdfdavid and liam have entered into a limited partnership where david i.pdf
david and liam have entered into a limited partnership where david i.pdf
 
Dave borrowed $1,150 on January 1, 2022. The bank charged him a $4.5.pdf
Dave borrowed $1,150 on January 1, 2022. The bank charged him a $4.5.pdfDave borrowed $1,150 on January 1, 2022. The bank charged him a $4.5.pdf
Dave borrowed $1,150 on January 1, 2022. The bank charged him a $4.5.pdf
 
Data Security Read the article below and answer the following questi.pdf
Data Security Read the article below and answer the following questi.pdfData Security Read the article below and answer the following questi.pdf
Data Security Read the article below and answer the following questi.pdf
 
Daniel Browning Smith has been named the most flexible man alive. Sm.pdf
Daniel Browning Smith has been named the most flexible man alive. Sm.pdfDaniel Browning Smith has been named the most flexible man alive. Sm.pdf
Daniel Browning Smith has been named the most flexible man alive. Sm.pdf
 
d. What is the total value of the company as of year 0 e. What is.pdf
d. What is the total value of the company as of year 0 e. What is.pdfd. What is the total value of the company as of year 0 e. What is.pdf
d. What is the total value of the company as of year 0 e. What is.pdf
 
D) good genes ^^^ Which of the following isare example(s) of as.pdf
D) good genes ^^^ Which of the following isare example(s) of as.pdfD) good genes ^^^ Which of the following isare example(s) of as.pdf
D) good genes ^^^ Which of the following isare example(s) of as.pdf
 
Donita Murphy is a primary care physician at a local community pract.pdf
Donita Murphy is a primary care physician at a local community pract.pdfDonita Murphy is a primary care physician at a local community pract.pdf
Donita Murphy is a primary care physician at a local community pract.pdf
 
Dolphin Co., 2017 ylnda 1.500 $ �cret ald ve bunun 13� 2018de kaz.pdf
Dolphin Co., 2017 ylnda 1.500 $ �cret ald ve bunun 13� 2018de kaz.pdfDolphin Co., 2017 ylnda 1.500 $ �cret ald ve bunun 13� 2018de kaz.pdf
Dolphin Co., 2017 ylnda 1.500 $ �cret ald ve bunun 13� 2018de kaz.pdf
 
Do you agree with how countries in this part of the world have been .pdf
Do you agree with how countries in this part of the world have been .pdfDo you agree with how countries in this part of the world have been .pdf
Do you agree with how countries in this part of the world have been .pdf
 
DO NOT use System.exit().DO NOT add the project or package stateme.pdf
DO NOT use System.exit().DO NOT add the project or package stateme.pdfDO NOT use System.exit().DO NOT add the project or package stateme.pdf
DO NOT use System.exit().DO NOT add the project or package stateme.pdf
 

Último

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 

Último (20)

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 

Create another four objects, this time, using the new operator, one .pdf

  • 1. Create another four objects, this time, using the new operator, one object per constructor, and on each object call the print function. #include #include using namespace std; class Employee { private: int id; string name; short age; public: Employee() : id(7700), name("Luke Skywalker"), age(29) {} Employee(int emp_id) : id(emp_id), name("Indiana Jones"), age(80) {} Employee(int emp_id, string emp_name) : id(emp_id), name(emp_name), age(29) {} Employee(int emp_id, string emp_name, short emp_age) : id(emp_id), name(emp_name), age(emp_age) {} void print() { cout << "Employee ID: " << id << endl; cout << "Name: " << name << endl; cout << "Age: " << age << endl; } }; int main() { Employee emp1; emp1.print(); Employee emp2(99134); emp2.print();
  • 2. Employee emp3(7700, "Steven Bradshaw"); emp3.print(); Employee emp4(2187, "Mike Tyson", 56); emp4.print(); return 0; } OUTPUT: Employee ID: 7700 Name: Luke Skywalker Age: 29 Employee ID: 99134 Name: Indiana Jones Age: 80 Employee ID: 7700 Name: Steven Bradshaw Age: 29 Employee ID: 2187 Name: Mike Tyson Age: 56