SlideShare a Scribd company logo
1 of 1
Download to read offline
Consider the following C++ program and rewrite the output function as: 1. Non-member function 2.
Friend function Then call both from main and print out the result. #include > using namespace std;
class Money i public: Money(int dollars, int cents); Money(int dollars); Money0: double get value(;
void input (0; void output(O; int get_all_cents O { return all_cents; } private: int all_cents; i; int
main() f Money income; income.input 0 ; cout "Income = "; income.output 0 ; cout << endl;
system("pause"); return 0 ; 3 Money:: Money(int dollars, int cents) i if (dollars*cents <0 ) //If one is
negative and one is positive f cout "Illegal values for dollars and cents. lnn; exit(1); 3 all_cents =
dollars 100+ cents; 3 Money::Money(int dollars) : all_cents(dollars * 100) i //Body intentionally
blank. Money::Money 0 ; all_cents( 0 ) f //Body intentionally blank. 3 double Money::get
value()Money::Money(int dollars, int cents) i if (dollars*cents <0 ) //f one is negative and one is
positive

More Related Content

Similar to Consider the following C++ program and rewrite the output fu.pdf

C programming Lab 2
C programming Lab 2C programming Lab 2
C programming Lab 2Zaibi Gondal
 
We reproduce the class Money here- in part- class Money{ public- Mone.docx
We reproduce the class Money here- in part- class Money{ public-  Mone.docxWe reproduce the class Money here- in part- class Money{ public-  Mone.docx
We reproduce the class Money here- in part- class Money{ public- Mone.docxmtruman1
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cppNilesh Dalvi
 
c++ practical Digvajiya collage Rajnandgaon
c++ practical  Digvajiya collage Rajnandgaonc++ practical  Digvajiya collage Rajnandgaon
c++ practical Digvajiya collage Rajnandgaonyash production
 
C chap02
C chap02C chap02
C chap02Kamran
 
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxPROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxamrit47
 
Write C++ program that when given a value N(read from cin)- produces a.docx
Write C++ program that when given a value N(read from cin)- produces a.docxWrite C++ program that when given a value N(read from cin)- produces a.docx
Write C++ program that when given a value N(read from cin)- produces a.docxkarlynwih
 
C# 6Write a program that creates a Calculation ClassUse the foll.pdf
C# 6Write a program that creates a Calculation ClassUse the foll.pdfC# 6Write a program that creates a Calculation ClassUse the foll.pdf
C# 6Write a program that creates a Calculation ClassUse the foll.pdfssuserc77a341
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfyamew16788
 
This what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdfThis what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdfkavithaarp
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101premrings
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorJussi Pohjolainen
 
Core programming in c
Core programming in cCore programming in c
Core programming in cRahul Pandit
 
basics of C and c++ by eteaching
basics of C and c++ by eteachingbasics of C and c++ by eteaching
basics of C and c++ by eteachingeteaching
 
Lo39
Lo39Lo39
Lo39lksoo
 

Similar to Consider the following C++ program and rewrite the output fu.pdf (20)

C programming Lab 2
C programming Lab 2C programming Lab 2
C programming Lab 2
 
We reproduce the class Money here- in part- class Money{ public- Mone.docx
We reproduce the class Money here- in part- class Money{ public-  Mone.docxWe reproduce the class Money here- in part- class Money{ public-  Mone.docx
We reproduce the class Money here- in part- class Money{ public- Mone.docx
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
c++ practical Digvajiya collage Rajnandgaon
c++ practical  Digvajiya collage Rajnandgaonc++ practical  Digvajiya collage Rajnandgaon
c++ practical Digvajiya collage Rajnandgaon
 
C chap02
C chap02C chap02
C chap02
 
C chap02
C chap02C chap02
C chap02
 
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxPROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
 
Write C++ program that when given a value N(read from cin)- produces a.docx
Write C++ program that when given a value N(read from cin)- produces a.docxWrite C++ program that when given a value N(read from cin)- produces a.docx
Write C++ program that when given a value N(read from cin)- produces a.docx
 
C++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdfC++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdf
 
C# 6Write a program that creates a Calculation ClassUse the foll.pdf
C# 6Write a program that creates a Calculation ClassUse the foll.pdfC# 6Write a program that creates a Calculation ClassUse the foll.pdf
C# 6Write a program that creates a Calculation ClassUse the foll.pdf
 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
 
This what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdfThis what Im suppose to do and this is what I have so far.In thi.pdf
This what Im suppose to do and this is what I have so far.In thi.pdf
 
54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
 
Cinfo
CinfoCinfo
Cinfo
 
Program presentation
Program presentationProgram presentation
Program presentation
 
CP 04.pptx
CP 04.pptxCP 04.pptx
CP 04.pptx
 
basics of C and c++ by eteaching
basics of C and c++ by eteachingbasics of C and c++ by eteaching
basics of C and c++ by eteaching
 
Lo39
Lo39Lo39
Lo39
 

More from naslin841216

Ynetim Liderlik Vaka almas Maria ailelere destek salay.pdf
Ynetim Liderlik Vaka almas  Maria ailelere destek salay.pdfYnetim Liderlik Vaka almas  Maria ailelere destek salay.pdf
Ynetim Liderlik Vaka almas Maria ailelere destek salay.pdfnaslin841216
 
Which of the following is not component of Emotional Intelli.pdf
Which of the following is not component of Emotional Intelli.pdfWhich of the following is not component of Emotional Intelli.pdf
Which of the following is not component of Emotional Intelli.pdfnaslin841216
 
Study B Roots Roots and stems often appear similar except .pdf
Study B Roots Roots and stems often appear similar except .pdfStudy B Roots Roots and stems often appear similar except .pdf
Study B Roots Roots and stems often appear similar except .pdfnaslin841216
 
Resumen del caso 253 Contratos de compraventa internaciona.pdf
Resumen del caso 253 Contratos de compraventa internaciona.pdfResumen del caso 253 Contratos de compraventa internaciona.pdf
Resumen del caso 253 Contratos de compraventa internaciona.pdfnaslin841216
 
Question Content Area Use the information provided for Prive.pdf
Question Content Area Use the information provided for Prive.pdfQuestion Content Area Use the information provided for Prive.pdf
Question Content Area Use the information provided for Prive.pdfnaslin841216
 
PREGUNTA 16 Los siguientes son genotipos de merocigotos de.pdf
PREGUNTA 16  Los siguientes son genotipos de merocigotos de.pdfPREGUNTA 16  Los siguientes son genotipos de merocigotos de.pdf
PREGUNTA 16 Los siguientes son genotipos de merocigotos de.pdfnaslin841216
 
Please answer all or do not answer at all 1 Nearly all ign.pdf
Please answer all or do not answer at all 1 Nearly all ign.pdfPlease answer all or do not answer at all 1 Nearly all ign.pdf
Please answer all or do not answer at all 1 Nearly all ign.pdfnaslin841216
 
please summarize i will hit like The year 2021 in Sweden con.pdf
please summarize i will hit like The year 2021 in Sweden con.pdfplease summarize i will hit like The year 2021 in Sweden con.pdf
please summarize i will hit like The year 2021 in Sweden con.pdfnaslin841216
 
On average indoor cats live to 12 years old with a standard.pdf
On average indoor cats live to 12 years old with a standard.pdfOn average indoor cats live to 12 years old with a standard.pdf
On average indoor cats live to 12 years old with a standard.pdfnaslin841216
 
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfinclude ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfnaslin841216
 
Grace makes sure that she walks by her bosss office several.pdf
Grace makes sure that she walks by her bosss office several.pdfGrace makes sure that she walks by her bosss office several.pdf
Grace makes sure that she walks by her bosss office several.pdfnaslin841216
 
Conversion of G3P to RuBP energy and it is coupled to releas.pdf
Conversion of G3P to RuBP energy and it is coupled to releas.pdfConversion of G3P to RuBP energy and it is coupled to releas.pdf
Conversion of G3P to RuBP energy and it is coupled to releas.pdfnaslin841216
 
need on c++ Task 1 Design a class for Singly linked List wi.pdf
need on c++ Task 1 Design a class for Singly linked List wi.pdfneed on c++ Task 1 Design a class for Singly linked List wi.pdf
need on c++ Task 1 Design a class for Singly linked List wi.pdfnaslin841216
 
In the test of hypotheses about three or more population mea.pdf
In the test of hypotheses about three or more population mea.pdfIn the test of hypotheses about three or more population mea.pdf
In the test of hypotheses about three or more population mea.pdfnaslin841216
 
During the current year Brewer Company acquired all of the .pdf
During the current year Brewer Company acquired all of the .pdfDuring the current year Brewer Company acquired all of the .pdf
During the current year Brewer Company acquired all of the .pdfnaslin841216
 
ii If the second segment is lost what is the acknowledgeme.pdf
ii If the second segment is lost what is the acknowledgeme.pdfii If the second segment is lost what is the acknowledgeme.pdf
ii If the second segment is lost what is the acknowledgeme.pdfnaslin841216
 
Given the matrices B132122Fpath dM403 1759 V84 H666 .pdf
Given the matrices B132122Fpath dM403 1759 V84 H666 .pdfGiven the matrices B132122Fpath dM403 1759 V84 H666 .pdf
Given the matrices B132122Fpath dM403 1759 V84 H666 .pdfnaslin841216
 
Destruction results in loss of communication between the R a.pdf
Destruction results in loss of communication between the R a.pdfDestruction results in loss of communication between the R a.pdf
Destruction results in loss of communication between the R a.pdfnaslin841216
 
As of 2010 Xerox Corporation NYSE XRX is a 22 billion .pdf
As of 2010 Xerox Corporation NYSE XRX is a 22 billion .pdfAs of 2010 Xerox Corporation NYSE XRX is a 22 billion .pdf
As of 2010 Xerox Corporation NYSE XRX is a 22 billion .pdfnaslin841216
 
ACCT 215 CT Accounting Cycle Problem The John Marshall Com.pdf
ACCT 215 CT Accounting Cycle Problem The John Marshall Com.pdfACCT 215 CT Accounting Cycle Problem The John Marshall Com.pdf
ACCT 215 CT Accounting Cycle Problem The John Marshall Com.pdfnaslin841216
 

More from naslin841216 (20)

Ynetim Liderlik Vaka almas Maria ailelere destek salay.pdf
Ynetim Liderlik Vaka almas  Maria ailelere destek salay.pdfYnetim Liderlik Vaka almas  Maria ailelere destek salay.pdf
Ynetim Liderlik Vaka almas Maria ailelere destek salay.pdf
 
Which of the following is not component of Emotional Intelli.pdf
Which of the following is not component of Emotional Intelli.pdfWhich of the following is not component of Emotional Intelli.pdf
Which of the following is not component of Emotional Intelli.pdf
 
Study B Roots Roots and stems often appear similar except .pdf
Study B Roots Roots and stems often appear similar except .pdfStudy B Roots Roots and stems often appear similar except .pdf
Study B Roots Roots and stems often appear similar except .pdf
 
Resumen del caso 253 Contratos de compraventa internaciona.pdf
Resumen del caso 253 Contratos de compraventa internaciona.pdfResumen del caso 253 Contratos de compraventa internaciona.pdf
Resumen del caso 253 Contratos de compraventa internaciona.pdf
 
Question Content Area Use the information provided for Prive.pdf
Question Content Area Use the information provided for Prive.pdfQuestion Content Area Use the information provided for Prive.pdf
Question Content Area Use the information provided for Prive.pdf
 
PREGUNTA 16 Los siguientes son genotipos de merocigotos de.pdf
PREGUNTA 16  Los siguientes son genotipos de merocigotos de.pdfPREGUNTA 16  Los siguientes son genotipos de merocigotos de.pdf
PREGUNTA 16 Los siguientes son genotipos de merocigotos de.pdf
 
Please answer all or do not answer at all 1 Nearly all ign.pdf
Please answer all or do not answer at all 1 Nearly all ign.pdfPlease answer all or do not answer at all 1 Nearly all ign.pdf
Please answer all or do not answer at all 1 Nearly all ign.pdf
 
please summarize i will hit like The year 2021 in Sweden con.pdf
please summarize i will hit like The year 2021 in Sweden con.pdfplease summarize i will hit like The year 2021 in Sweden con.pdf
please summarize i will hit like The year 2021 in Sweden con.pdf
 
On average indoor cats live to 12 years old with a standard.pdf
On average indoor cats live to 12 years old with a standard.pdfOn average indoor cats live to 12 years old with a standard.pdf
On average indoor cats live to 12 years old with a standard.pdf
 
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdfinclude ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdf
 
Grace makes sure that she walks by her bosss office several.pdf
Grace makes sure that she walks by her bosss office several.pdfGrace makes sure that she walks by her bosss office several.pdf
Grace makes sure that she walks by her bosss office several.pdf
 
Conversion of G3P to RuBP energy and it is coupled to releas.pdf
Conversion of G3P to RuBP energy and it is coupled to releas.pdfConversion of G3P to RuBP energy and it is coupled to releas.pdf
Conversion of G3P to RuBP energy and it is coupled to releas.pdf
 
need on c++ Task 1 Design a class for Singly linked List wi.pdf
need on c++ Task 1 Design a class for Singly linked List wi.pdfneed on c++ Task 1 Design a class for Singly linked List wi.pdf
need on c++ Task 1 Design a class for Singly linked List wi.pdf
 
In the test of hypotheses about three or more population mea.pdf
In the test of hypotheses about three or more population mea.pdfIn the test of hypotheses about three or more population mea.pdf
In the test of hypotheses about three or more population mea.pdf
 
During the current year Brewer Company acquired all of the .pdf
During the current year Brewer Company acquired all of the .pdfDuring the current year Brewer Company acquired all of the .pdf
During the current year Brewer Company acquired all of the .pdf
 
ii If the second segment is lost what is the acknowledgeme.pdf
ii If the second segment is lost what is the acknowledgeme.pdfii If the second segment is lost what is the acknowledgeme.pdf
ii If the second segment is lost what is the acknowledgeme.pdf
 
Given the matrices B132122Fpath dM403 1759 V84 H666 .pdf
Given the matrices B132122Fpath dM403 1759 V84 H666 .pdfGiven the matrices B132122Fpath dM403 1759 V84 H666 .pdf
Given the matrices B132122Fpath dM403 1759 V84 H666 .pdf
 
Destruction results in loss of communication between the R a.pdf
Destruction results in loss of communication between the R a.pdfDestruction results in loss of communication between the R a.pdf
Destruction results in loss of communication between the R a.pdf
 
As of 2010 Xerox Corporation NYSE XRX is a 22 billion .pdf
As of 2010 Xerox Corporation NYSE XRX is a 22 billion .pdfAs of 2010 Xerox Corporation NYSE XRX is a 22 billion .pdf
As of 2010 Xerox Corporation NYSE XRX is a 22 billion .pdf
 
ACCT 215 CT Accounting Cycle Problem The John Marshall Com.pdf
ACCT 215 CT Accounting Cycle Problem The John Marshall Com.pdfACCT 215 CT Accounting Cycle Problem The John Marshall Com.pdf
ACCT 215 CT Accounting Cycle Problem The John Marshall Com.pdf
 

Recently uploaded

會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17Celine George
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MysoreMuleSoftMeetup
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 

Recently uploaded (20)

會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 

Consider the following C++ program and rewrite the output fu.pdf

  • 1. Consider the following C++ program and rewrite the output function as: 1. Non-member function 2. Friend function Then call both from main and print out the result. #include > using namespace std; class Money i public: Money(int dollars, int cents); Money(int dollars); Money0: double get value(; void input (0; void output(O; int get_all_cents O { return all_cents; } private: int all_cents; i; int main() f Money income; income.input 0 ; cout "Income = "; income.output 0 ; cout << endl; system("pause"); return 0 ; 3 Money:: Money(int dollars, int cents) i if (dollars*cents <0 ) //If one is negative and one is positive f cout "Illegal values for dollars and cents. lnn; exit(1); 3 all_cents = dollars 100+ cents; 3 Money::Money(int dollars) : all_cents(dollars * 100) i //Body intentionally blank. Money::Money 0 ; all_cents( 0 ) f //Body intentionally blank. 3 double Money::get value()Money::Money(int dollars, int cents) i if (dollars*cents <0 ) //f one is negative and one is positive