SlideShare a Scribd company logo
1 of 3
Question 1:Â Â Find the value of the following C++ expressions.
Write the output of the following
Assumption: addresses
int val [ 3 ] = { 1 , 2 , 3 }
int *ptrVal
ptrVal = &val [ 0 ]
cout << val =
cout<< ptrval =
cout << &val [2] =
cout << *ptrVal++ =
cout << ++*ptrVal =
Question 2: Write a class "employee" with the needed sets of public/private variable and
functions to get the below result.
int main () {
employee employee 1;   //define object   // of class part
employee . set_employee ( "John" , "Doe" , 47 ) ;Â Â // call memeber function
employee1 . show_employee () ;Â Â //call memeber function
return 0 ;
}
******************************************************************************
***
Employee's First Name:Â Â Â John
Employee's Last Name:Â Â Doe
Employee's Age:Â Â 47
******************************************************************************
***
X1001 X1002 X1003
Solution
Question 1)
X1001
X1001
X1003
1
3
Question 2)
#include<iostream>
#include<string>
using namespace std;
class employee
{
private:
string fname;
string lname;
int age;
public:
void set_employee(string f,string l,int a)
{
fname=f;
lname=l;
age=a;
}
void show_employee()
{
cout<<"**********************************************************************
***********"<<endl;
cout<<"Employee's First Name: "<<fname<<endl;
cout<<"Employee's Last Name: "<<lname<<endl;
cout<<"Employee's Age: "<<age<<endl;
cout<<"**********************************************************************
***********"<<endl;
}
};
int main ()
{
employee employee1; //define object // of class part
employee1.set_employee ( "John", "Doe", 47 ) ; // call memeber function
employee1.show_employee () ; //call memeber function
return 0 ;
}

More Related Content

Similar to Question 1- Find the value of the following C++ expressions- Write the.docx

Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
Task4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docxTask4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docx
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docxjosies1
 
friends functionToshu
friends functionToshufriends functionToshu
friends functionToshuSidd Singh
 
Lecture 9_Classes.pptx
Lecture 9_Classes.pptxLecture 9_Classes.pptx
Lecture 9_Classes.pptxNelyJay
 
Module wise format oops questions
Module wise format oops questionsModule wise format oops questions
Module wise format oops questionsSANTOSH RATH
 
2. Create a Java class called EmployeeMain within the same project Pr.docx
 2. Create a Java class called EmployeeMain within the same project Pr.docx 2. Create a Java class called EmployeeMain within the same project Pr.docx
2. Create a Java class called EmployeeMain within the same project Pr.docxajoy21
 
Navigating the xDD Alphabet Soup
Navigating the xDD Alphabet SoupNavigating the xDD Alphabet Soup
Navigating the xDD Alphabet SoupDror Helper
 
Part APurposeThis laboratory provides some experience work.docx
Part APurposeThis laboratory provides some experience work.docxPart APurposeThis laboratory provides some experience work.docx
Part APurposeThis laboratory provides some experience work.docxdewhirstichabod
 
I have the first program completed (not how request, but it works) a.pdf
I have the first program completed (not how request, but it works) a.pdfI have the first program completed (not how request, but it works) a.pdf
I have the first program completed (not how request, but it works) a.pdffootworld1
 
I can't figure out why it wont compile! How do I create the different.pdf
I can't figure out why it wont compile! How do I create the different.pdfI can't figure out why it wont compile! How do I create the different.pdf
I can't figure out why it wont compile! How do I create the different.pdfColinjHJParsonsa
 
The Hidden Face of Cost-Based Optimizer: PL/SQL Specific Statistics
The Hidden Face of Cost-Based Optimizer: PL/SQL Specific StatisticsThe Hidden Face of Cost-Based Optimizer: PL/SQL Specific Statistics
The Hidden Face of Cost-Based Optimizer: PL/SQL Specific StatisticsMichael Rosenblum
 
Virtual function
Virtual functionVirtual function
Virtual functionharman kaur
 
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptxCONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptxDeepasCSE
 

Similar to Question 1- Find the value of the following C++ expressions- Write the.docx (20)

Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
Task4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docxTask4output.txt 2  5  9 13 15 10  1  0  3  7 11 14 1.docx
Task4output.txt 2 5 9 13 15 10 1 0 3 7 11 14 1.docx
 
friends functionToshu
friends functionToshufriends functionToshu
friends functionToshu
 
Lecture 9_Classes.pptx
Lecture 9_Classes.pptxLecture 9_Classes.pptx
Lecture 9_Classes.pptx
 
C# labprograms
C# labprogramsC# labprograms
C# labprograms
 
Module wise format oops questions
Module wise format oops questionsModule wise format oops questions
Module wise format oops questions
 
2. Create a Java class called EmployeeMain within the same project Pr.docx
 2. Create a Java class called EmployeeMain within the same project Pr.docx 2. Create a Java class called EmployeeMain within the same project Pr.docx
2. Create a Java class called EmployeeMain within the same project Pr.docx
 
Lecture2.ppt
Lecture2.pptLecture2.ppt
Lecture2.ppt
 
Navigating the xDD Alphabet Soup
Navigating the xDD Alphabet SoupNavigating the xDD Alphabet Soup
Navigating the xDD Alphabet Soup
 
Part APurposeThis laboratory provides some experience work.docx
Part APurposeThis laboratory provides some experience work.docxPart APurposeThis laboratory provides some experience work.docx
Part APurposeThis laboratory provides some experience work.docx
 
I have the first program completed (not how request, but it works) a.pdf
I have the first program completed (not how request, but it works) a.pdfI have the first program completed (not how request, but it works) a.pdf
I have the first program completed (not how request, but it works) a.pdf
 
I can't figure out why it wont compile! How do I create the different.pdf
I can't figure out why it wont compile! How do I create the different.pdfI can't figure out why it wont compile! How do I create the different.pdf
I can't figure out why it wont compile! How do I create the different.pdf
 
4.3 Hibernate example.docx
4.3 Hibernate example.docx4.3 Hibernate example.docx
4.3 Hibernate example.docx
 
The Hidden Face of Cost-Based Optimizer: PL/SQL Specific Statistics
The Hidden Face of Cost-Based Optimizer: PL/SQL Specific StatisticsThe Hidden Face of Cost-Based Optimizer: PL/SQL Specific Statistics
The Hidden Face of Cost-Based Optimizer: PL/SQL Specific Statistics
 
Computer Programming- Lecture 10
Computer Programming- Lecture 10Computer Programming- Lecture 10
Computer Programming- Lecture 10
 
C++ file
C++ fileC++ file
C++ file
 
C++ file
C++ fileC++ file
C++ file
 
C++ L07-Struct
C++ L07-StructC++ L07-Struct
C++ L07-Struct
 
MV sql profile and index
MV sql profile and indexMV sql profile and index
MV sql profile and index
 
Virtual function
Virtual functionVirtual function
Virtual function
 
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptxCONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
CONSTRUCTORS, DESTRUCTORS AND OPERATOR OVERLOADING.pptx
 

More from todd921

Question 1 2 points Save Team building is designed to gather.docx
Question 1  2  points    Save    Team  building is designed to gather.docxQuestion 1  2  points    Save    Team  building is designed to gather.docx
Question 1 2 points Save Team building is designed to gather.docxtodd921
 
Question 21 2 points Save How do training and development with.docx
Question  21  2 points   Save    How do training and development with.docxQuestion  21  2 points   Save    How do training and development with.docx
Question 21 2 points Save How do training and development with.docxtodd921
 
QS# 2- 9-17 What is the difference between a note payable and an accou.docx
QS# 2- 9-17 What is the difference between a note payable and an accou.docxQS# 2- 9-17 What is the difference between a note payable and an accou.docx
QS# 2- 9-17 What is the difference between a note payable and an accou.docxtodd921
 
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docx
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docxQ1) Prepare the year end closing entries for eagles corp- Q2) what is.docx
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docxtodd921
 
Q- Lord Rutherford found that most of an atom consists of empty space-.docx
Q- Lord Rutherford found that most of an atom consists of empty space-.docxQ- Lord Rutherford found that most of an atom consists of empty space-.docx
Q- Lord Rutherford found that most of an atom consists of empty space-.docxtodd921
 
PYTHON Programming Language Design a class named Account that contains.docx
PYTHON Programming Language Design a class named Account that contains.docxPYTHON Programming Language Design a class named Account that contains.docx
PYTHON Programming Language Design a class named Account that contains.docxtodd921
 
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docx
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docxPurchases Date Units Unit Cost Sales Units Average cost for each unit.docx
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docxtodd921
 
Provide examples of applications that typically access files according.docx
Provide examples of applications that typically access files according.docxProvide examples of applications that typically access files according.docx
Provide examples of applications that typically access files according.docxtodd921
 
Provide copy constructor- destructor- and assignment operator for the.docx
Provide copy constructor- destructor- and assignment operator for the.docxProvide copy constructor- destructor- and assignment operator for the.docx
Provide copy constructor- destructor- and assignment operator for the.docxtodd921
 
Provide a summary of the basic ideals and significant individuals behi.docx
Provide a summary of the basic ideals and significant individuals behi.docxProvide a summary of the basic ideals and significant individuals behi.docx
Provide a summary of the basic ideals and significant individuals behi.docxtodd921
 
proposed solution to resource sharing and security against unauthorize.docx
proposed solution to resource sharing and security against unauthorize.docxproposed solution to resource sharing and security against unauthorize.docx
proposed solution to resource sharing and security against unauthorize.docxtodd921
 
Programming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docxProgramming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docxtodd921
 
Question 30 As people become more powerful they tend to become less go.docx
Question 30 As people become more powerful they tend to become less go.docxQuestion 30 As people become more powerful they tend to become less go.docx
Question 30 As people become more powerful they tend to become less go.docxtodd921
 
Question 34 People with high Machiavellian values tend to- place a lot.docx
Question 34 People with high Machiavellian values tend to- place a lot.docxQuestion 34 People with high Machiavellian values tend to- place a lot.docx
Question 34 People with high Machiavellian values tend to- place a lot.docxtodd921
 
Question 21 Resource scarcity is a likely cause of conflict in organiz.docx
Question 21 Resource scarcity is a likely cause of conflict in organiz.docxQuestion 21 Resource scarcity is a likely cause of conflict in organiz.docx
Question 21 Resource scarcity is a likely cause of conflict in organiz.docxtodd921
 
Question 2 Compare the eye to a camera by listing four of the basic co.docx
Question 2 Compare the eye to a camera by listing four of the basic co.docxQuestion 2 Compare the eye to a camera by listing four of the basic co.docx
Question 2 Compare the eye to a camera by listing four of the basic co.docxtodd921
 
Question 1- The alien species has decided that they will use a special.docx
Question 1- The alien species has decided that they will use a special.docxQuestion 1- The alien species has decided that they will use a special.docx
Question 1- The alien species has decided that they will use a special.docxtodd921
 
Question 13 Which of the following is the first stage of an experienti.docx
Question 13 Which of the following is the first stage of an experienti.docxQuestion 13 Which of the following is the first stage of an experienti.docx
Question 13 Which of the following is the first stage of an experienti.docxtodd921
 
Question 11 Active communication occurs by facial expressions- body po.docx
Question 11 Active communication occurs by facial expressions- body po.docxQuestion 11 Active communication occurs by facial expressions- body po.docx
Question 11 Active communication occurs by facial expressions- body po.docxtodd921
 
QUESTION 1 Interaction Design is designing interactive products to sup.docx
QUESTION 1 Interaction Design is designing interactive products to sup.docxQUESTION 1 Interaction Design is designing interactive products to sup.docx
QUESTION 1 Interaction Design is designing interactive products to sup.docxtodd921
 

More from todd921 (20)

Question 1 2 points Save Team building is designed to gather.docx
Question 1  2  points    Save    Team  building is designed to gather.docxQuestion 1  2  points    Save    Team  building is designed to gather.docx
Question 1 2 points Save Team building is designed to gather.docx
 
Question 21 2 points Save How do training and development with.docx
Question  21  2 points   Save    How do training and development with.docxQuestion  21  2 points   Save    How do training and development with.docx
Question 21 2 points Save How do training and development with.docx
 
QS# 2- 9-17 What is the difference between a note payable and an accou.docx
QS# 2- 9-17 What is the difference between a note payable and an accou.docxQS# 2- 9-17 What is the difference between a note payable and an accou.docx
QS# 2- 9-17 What is the difference between a note payable and an accou.docx
 
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docx
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docxQ1) Prepare the year end closing entries for eagles corp- Q2) what is.docx
Q1) Prepare the year end closing entries for eagles corp- Q2) what is.docx
 
Q- Lord Rutherford found that most of an atom consists of empty space-.docx
Q- Lord Rutherford found that most of an atom consists of empty space-.docxQ- Lord Rutherford found that most of an atom consists of empty space-.docx
Q- Lord Rutherford found that most of an atom consists of empty space-.docx
 
PYTHON Programming Language Design a class named Account that contains.docx
PYTHON Programming Language Design a class named Account that contains.docxPYTHON Programming Language Design a class named Account that contains.docx
PYTHON Programming Language Design a class named Account that contains.docx
 
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docx
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docxPurchases Date Units Unit Cost Sales Units Average cost for each unit.docx
Purchases Date Units Unit Cost Sales Units Average cost for each unit.docx
 
Provide examples of applications that typically access files according.docx
Provide examples of applications that typically access files according.docxProvide examples of applications that typically access files according.docx
Provide examples of applications that typically access files according.docx
 
Provide copy constructor- destructor- and assignment operator for the.docx
Provide copy constructor- destructor- and assignment operator for the.docxProvide copy constructor- destructor- and assignment operator for the.docx
Provide copy constructor- destructor- and assignment operator for the.docx
 
Provide a summary of the basic ideals and significant individuals behi.docx
Provide a summary of the basic ideals and significant individuals behi.docxProvide a summary of the basic ideals and significant individuals behi.docx
Provide a summary of the basic ideals and significant individuals behi.docx
 
proposed solution to resource sharing and security against unauthorize.docx
proposed solution to resource sharing and security against unauthorize.docxproposed solution to resource sharing and security against unauthorize.docx
proposed solution to resource sharing and security against unauthorize.docx
 
Programming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docxProgramming Language- C++ or Java Write to program to generate a pair.docx
Programming Language- C++ or Java Write to program to generate a pair.docx
 
Question 30 As people become more powerful they tend to become less go.docx
Question 30 As people become more powerful they tend to become less go.docxQuestion 30 As people become more powerful they tend to become less go.docx
Question 30 As people become more powerful they tend to become less go.docx
 
Question 34 People with high Machiavellian values tend to- place a lot.docx
Question 34 People with high Machiavellian values tend to- place a lot.docxQuestion 34 People with high Machiavellian values tend to- place a lot.docx
Question 34 People with high Machiavellian values tend to- place a lot.docx
 
Question 21 Resource scarcity is a likely cause of conflict in organiz.docx
Question 21 Resource scarcity is a likely cause of conflict in organiz.docxQuestion 21 Resource scarcity is a likely cause of conflict in organiz.docx
Question 21 Resource scarcity is a likely cause of conflict in organiz.docx
 
Question 2 Compare the eye to a camera by listing four of the basic co.docx
Question 2 Compare the eye to a camera by listing four of the basic co.docxQuestion 2 Compare the eye to a camera by listing four of the basic co.docx
Question 2 Compare the eye to a camera by listing four of the basic co.docx
 
Question 1- The alien species has decided that they will use a special.docx
Question 1- The alien species has decided that they will use a special.docxQuestion 1- The alien species has decided that they will use a special.docx
Question 1- The alien species has decided that they will use a special.docx
 
Question 13 Which of the following is the first stage of an experienti.docx
Question 13 Which of the following is the first stage of an experienti.docxQuestion 13 Which of the following is the first stage of an experienti.docx
Question 13 Which of the following is the first stage of an experienti.docx
 
Question 11 Active communication occurs by facial expressions- body po.docx
Question 11 Active communication occurs by facial expressions- body po.docxQuestion 11 Active communication occurs by facial expressions- body po.docx
Question 11 Active communication occurs by facial expressions- body po.docx
 
QUESTION 1 Interaction Design is designing interactive products to sup.docx
QUESTION 1 Interaction Design is designing interactive products to sup.docxQUESTION 1 Interaction Design is designing interactive products to sup.docx
QUESTION 1 Interaction Design is designing interactive products to sup.docx
 

Recently uploaded

भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 

Question 1- Find the value of the following C++ expressions- Write the.docx

  • 1. Question 1:  Find the value of the following C++ expressions. Write the output of the following Assumption: addresses int val [ 3 ] = { 1 , 2 , 3 } int *ptrVal ptrVal = &val [ 0 ] cout << val = cout<< ptrval = cout << &val [2] = cout << *ptrVal++ = cout << ++*ptrVal = Question 2: Write a class "employee" with the needed sets of public/private variable and functions to get the below result. int main () { employee employee 1;   //define object   // of class part employee . set_employee ( "John" , "Doe" , 47 ) ;  // call memeber function employee1 . show_employee () ;  //call memeber function return 0 ; } ****************************************************************************** *** Employee's First Name:   John Employee's Last Name:  Doe Employee's Age:  47
  • 2. ****************************************************************************** *** X1001 X1002 X1003 Solution Question 1) X1001 X1001 X1003 1 3 Question 2) #include<iostream> #include<string> using namespace std; class employee { private: string fname; string lname; int age; public: void set_employee(string f,string l,int a) { fname=f; lname=l; age=a;
  • 3. } void show_employee() { cout<<"********************************************************************** ***********"<<endl; cout<<"Employee's First Name: "<<fname<<endl; cout<<"Employee's Last Name: "<<lname<<endl; cout<<"Employee's Age: "<<age<<endl; cout<<"********************************************************************** ***********"<<endl; } }; int main () { employee employee1; //define object // of class part employee1.set_employee ( "John", "Doe", 47 ) ; // call memeber function employee1.show_employee () ; //call memeber function return 0 ; }