SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
Question 1 ( 40 points) The ATM can have three kinds of money units (fifties, twenties, and
tens) Write a C+ ATM class to represent an ATM machine as the following (Separate header
from implementation): (a) Define the private data members fifties, twenties and tens (Data type
int for all of them) (4 points) b) A default constructor that initializes the fifties, twenties and tens
to 0 ( 4 points) 4 c) An initializer constructor that receives values for fifties, twenties and tens. (
4 points) d) Define a getter for fifties member variable. (4 points) (e) Define Deposit function
that receives values for fifties, twenties and tens. The function should add the received fifties to
the existing fifties, and so is the case for twenties and tens. For example, if the ATM machine
has 4 fifties, 2 twenties, and 3 tens before Deposit, and we call Deposit (3,7,10), then the ATM
should have 7 fifties (4+3),9 twenties (2+7), and 13 tens (3+10)(6 points) (f) Define int
GetATMTotalCash0 member function that returns the total cash it has. (5 points) (8) Define bool
HasMoreCash(ATM & a1) function which returns true if the current ATM has more balance
that ATM al object received. (4 points) h) Define bool Withdraw(int amount,int
&fifties_count,int &twenties_count, int &tens_count ) member function, it receives the amount
of cash the customer wants to withdraw, and if successful it returns true and specify the number
units it will return using (fifties_count, twenties_count, and tens_count). For example, if the
ATM machine has 4 fifties, 2 twenties, and 3 tens before withdraw, and we call Withdraw
(130,x,y,z), then the function should return true and make the ATM with 2 fifties (42),1 twenties
(21), and 2 tens (31), and set x,y, and z to 2,1,1 which will be 2 fifties +1 twenty +1 ten which
totals to 130. Moreover, for Withdraw (100,x,y,z), the function should return true and set x,y, z
to 2,0,0. Note, the function would return false in case the transaction was not possible (for
example Ino enough cash to return, or there is cash but existing money units will work such as
requested to withdraw 140 when the ATM has only 3 fifties) ( 6 points)

Contenu connexe

Similaire à Question 1 ( 40 points) The ATM can have three kinds of money units (.pdf

Similaire à Question 1 ( 40 points) The ATM can have three kinds of money units (.pdf (20)

Midterm
MidtermMidterm
Midterm
 
COM1407: Arrays
COM1407: ArraysCOM1407: Arrays
COM1407: Arrays
 
Java Tutorial: Part 4 - Data and Calculations
Java Tutorial: Part 4 - Data and CalculationsJava Tutorial: Part 4 - Data and Calculations
Java Tutorial: Part 4 - Data and Calculations
 
Midterm sols
Midterm solsMidterm sols
Midterm sols
 
Swift, via "swift-2048"
Swift, via "swift-2048"Swift, via "swift-2048"
Swift, via "swift-2048"
 
Java Foundations: Data Types and Type Conversion
Java Foundations: Data Types and Type ConversionJava Foundations: Data Types and Type Conversion
Java Foundations: Data Types and Type Conversion
 
Arrays
ArraysArrays
Arrays
 
Atomically { Delete Your Actors }
Atomically { Delete Your Actors }Atomically { Delete Your Actors }
Atomically { Delete Your Actors }
 
C# Arrays
C# ArraysC# Arrays
C# Arrays
 
Number Systems
Number  SystemsNumber  Systems
Number Systems
 
C++ Programming Homework Help
C++ Programming Homework HelpC++ Programming Homework Help
C++ Programming Homework Help
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 Solution
 
Acm aleppo cpc training second session
Acm aleppo cpc training second sessionAcm aleppo cpc training second session
Acm aleppo cpc training second session
 
Gans
GansGans
Gans
 
GANs
GANsGANs
GANs
 
Lec2&3 data structure
Lec2&3 data structureLec2&3 data structure
Lec2&3 data structure
 
Lec2
Lec2Lec2
Lec2
 
Lec2&3_DataStructure
Lec2&3_DataStructureLec2&3_DataStructure
Lec2&3_DataStructure
 
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfHello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
 
Mcq cpup
Mcq cpupMcq cpup
Mcq cpup
 

Plus de ahuja124

Required information NOTE This is a multi-part question. Once an ans.pdf
 Required information NOTE This is a multi-part question. Once an ans.pdf Required information NOTE This is a multi-part question. Once an ans.pdf
Required information NOTE This is a multi-part question. Once an ans.pdfahuja124
 
Regression Variables EnteredRemoved 2 a. Dependent Variable Risk b..pdf
 Regression Variables EnteredRemoved 2 a. Dependent Variable Risk b..pdf Regression Variables EnteredRemoved 2 a. Dependent Variable Risk b..pdf
Regression Variables EnteredRemoved 2 a. Dependent Variable Risk b..pdfahuja124
 
Reliability refers to consistency or repeatability of measures in r.pdf
 Reliability refers to consistency or repeatability of measures in r.pdf Reliability refers to consistency or repeatability of measures in r.pdf
Reliability refers to consistency or repeatability of measures in r.pdfahuja124
 
ReferenceFirst Clarss Mands Company has journaked the adjusting.pdf
 ReferenceFirst Clarss Mands Company has journaked the adjusting.pdf ReferenceFirst Clarss Mands Company has journaked the adjusting.pdf
ReferenceFirst Clarss Mands Company has journaked the adjusting.pdfahuja124
 
Refer to the graph. A shift from AS1 to AS2 would be consistent with .pdf
 Refer to the graph. A shift from AS1 to AS2 would be consistent with .pdf Refer to the graph. A shift from AS1 to AS2 would be consistent with .pdf
Refer to the graph. A shift from AS1 to AS2 would be consistent with .pdfahuja124
 
Refer to the diagram in which T is tax revenues and G is government e.pdf
 Refer to the diagram in which T is tax revenues and G is government e.pdf Refer to the diagram in which T is tax revenues and G is government e.pdf
Refer to the diagram in which T is tax revenues and G is government e.pdfahuja124
 
Recently Damar Hamlin had a cardiac arrest while playing football. Th.pdf
 Recently Damar Hamlin had a cardiac arrest while playing football. Th.pdf Recently Damar Hamlin had a cardiac arrest while playing football. Th.pdf
Recently Damar Hamlin had a cardiac arrest while playing football. Th.pdfahuja124
 
Real-Time Data Analysis Exercise Measures and Components of Money in.pdf
 Real-Time Data Analysis Exercise Measures and Components of Money in.pdf Real-Time Data Analysis Exercise Measures and Components of Money in.pdf
Real-Time Data Analysis Exercise Measures and Components of Money in.pdfahuja124
 
Rasei Compeiy has provided the foliewng comparative irfarmation You k.pdf
 Rasei Compeiy has provided the foliewng comparative irfarmation You k.pdf Rasei Compeiy has provided the foliewng comparative irfarmation You k.pdf
Rasei Compeiy has provided the foliewng comparative irfarmation You k.pdfahuja124
 
Raphael and Martina are engaged and are planning to travel to Las Veg.pdf
 Raphael and Martina are engaged and are planning to travel to Las Veg.pdf Raphael and Martina are engaged and are planning to travel to Las Veg.pdf
Raphael and Martina are engaged and are planning to travel to Las Veg.pdfahuja124
 
ransgression Regression Stratigraphic Column List possible EOD On t.pdf
 ransgression  Regression Stratigraphic Column List possible EOD On t.pdf ransgression  Regression Stratigraphic Column List possible EOD On t.pdf
ransgression Regression Stratigraphic Column List possible EOD On t.pdfahuja124
 
Questions 1. Be able to identify the different types of interactions.pdf
 Questions 1. Be able to identify the different types of interactions.pdf Questions 1. Be able to identify the different types of interactions.pdf
Questions 1. Be able to identify the different types of interactions.pdfahuja124
 
Question1) (20 points) Given n data samples {xi,yi}i=1,�,n. We usual.pdf
 Question1) (20 points) Given n data samples {xi,yi}i=1,�,n. We usual.pdf Question1) (20 points) Given n data samples {xi,yi}i=1,�,n. We usual.pdf
Question1) (20 points) Given n data samples {xi,yi}i=1,�,n. We usual.pdfahuja124
 
R. Allen Inc. R. Allen Inc. Income Statement Comparative Balance Shee.pdf
 R. Allen Inc. R. Allen Inc. Income Statement Comparative Balance Shee.pdf R. Allen Inc. R. Allen Inc. Income Statement Comparative Balance Shee.pdf
R. Allen Inc. R. Allen Inc. Income Statement Comparative Balance Shee.pdfahuja124
 
Question 7 (2 points) Refer to the below figure. There is a $75 milli.pdf
 Question 7 (2 points) Refer to the below figure. There is a $75 milli.pdf Question 7 (2 points) Refer to the below figure. There is a $75 milli.pdf
Question 7 (2 points) Refer to the below figure. There is a $75 milli.pdfahuja124
 
QUESTION 4 Part A Introduction In chromatography, solutes will follo.pdf
 QUESTION 4 Part A Introduction In chromatography, solutes will follo.pdf QUESTION 4 Part A Introduction In chromatography, solutes will follo.pdf
QUESTION 4 Part A Introduction In chromatography, solutes will follo.pdfahuja124
 
Question 4 A recent study focused on the number of times men and .pdf
 Question 4 A recent study focused on the number of times men and .pdf Question 4 A recent study focused on the number of times men and .pdf
Question 4 A recent study focused on the number of times men and .pdfahuja124
 
Question 4 ( 20 marks ) By relating it with the scenario in Malaysi.pdf
 Question 4 ( 20 marks ) By relating it with the scenario in Malaysi.pdf Question 4 ( 20 marks ) By relating it with the scenario in Malaysi.pdf
Question 4 ( 20 marks ) By relating it with the scenario in Malaysi.pdfahuja124
 
Question 4 4. Which of the following best defines the resource curse.pdf
 Question 4 4. Which of the following best defines the resource curse.pdf Question 4 4. Which of the following best defines the resource curse.pdf
Question 4 4. Which of the following best defines the resource curse.pdfahuja124
 
Question 12- Which of the following might suggest that a nurse.pdf
 Question 12- Which of the following might suggest that a nurse.pdf Question 12- Which of the following might suggest that a nurse.pdf
Question 12- Which of the following might suggest that a nurse.pdfahuja124
 

Plus de ahuja124 (20)

Required information NOTE This is a multi-part question. Once an ans.pdf
 Required information NOTE This is a multi-part question. Once an ans.pdf Required information NOTE This is a multi-part question. Once an ans.pdf
Required information NOTE This is a multi-part question. Once an ans.pdf
 
Regression Variables EnteredRemoved 2 a. Dependent Variable Risk b..pdf
 Regression Variables EnteredRemoved 2 a. Dependent Variable Risk b..pdf Regression Variables EnteredRemoved 2 a. Dependent Variable Risk b..pdf
Regression Variables EnteredRemoved 2 a. Dependent Variable Risk b..pdf
 
Reliability refers to consistency or repeatability of measures in r.pdf
 Reliability refers to consistency or repeatability of measures in r.pdf Reliability refers to consistency or repeatability of measures in r.pdf
Reliability refers to consistency or repeatability of measures in r.pdf
 
ReferenceFirst Clarss Mands Company has journaked the adjusting.pdf
 ReferenceFirst Clarss Mands Company has journaked the adjusting.pdf ReferenceFirst Clarss Mands Company has journaked the adjusting.pdf
ReferenceFirst Clarss Mands Company has journaked the adjusting.pdf
 
Refer to the graph. A shift from AS1 to AS2 would be consistent with .pdf
 Refer to the graph. A shift from AS1 to AS2 would be consistent with .pdf Refer to the graph. A shift from AS1 to AS2 would be consistent with .pdf
Refer to the graph. A shift from AS1 to AS2 would be consistent with .pdf
 
Refer to the diagram in which T is tax revenues and G is government e.pdf
 Refer to the diagram in which T is tax revenues and G is government e.pdf Refer to the diagram in which T is tax revenues and G is government e.pdf
Refer to the diagram in which T is tax revenues and G is government e.pdf
 
Recently Damar Hamlin had a cardiac arrest while playing football. Th.pdf
 Recently Damar Hamlin had a cardiac arrest while playing football. Th.pdf Recently Damar Hamlin had a cardiac arrest while playing football. Th.pdf
Recently Damar Hamlin had a cardiac arrest while playing football. Th.pdf
 
Real-Time Data Analysis Exercise Measures and Components of Money in.pdf
 Real-Time Data Analysis Exercise Measures and Components of Money in.pdf Real-Time Data Analysis Exercise Measures and Components of Money in.pdf
Real-Time Data Analysis Exercise Measures and Components of Money in.pdf
 
Rasei Compeiy has provided the foliewng comparative irfarmation You k.pdf
 Rasei Compeiy has provided the foliewng comparative irfarmation You k.pdf Rasei Compeiy has provided the foliewng comparative irfarmation You k.pdf
Rasei Compeiy has provided the foliewng comparative irfarmation You k.pdf
 
Raphael and Martina are engaged and are planning to travel to Las Veg.pdf
 Raphael and Martina are engaged and are planning to travel to Las Veg.pdf Raphael and Martina are engaged and are planning to travel to Las Veg.pdf
Raphael and Martina are engaged and are planning to travel to Las Veg.pdf
 
ransgression Regression Stratigraphic Column List possible EOD On t.pdf
 ransgression  Regression Stratigraphic Column List possible EOD On t.pdf ransgression  Regression Stratigraphic Column List possible EOD On t.pdf
ransgression Regression Stratigraphic Column List possible EOD On t.pdf
 
Questions 1. Be able to identify the different types of interactions.pdf
 Questions 1. Be able to identify the different types of interactions.pdf Questions 1. Be able to identify the different types of interactions.pdf
Questions 1. Be able to identify the different types of interactions.pdf
 
Question1) (20 points) Given n data samples {xi,yi}i=1,�,n. We usual.pdf
 Question1) (20 points) Given n data samples {xi,yi}i=1,�,n. We usual.pdf Question1) (20 points) Given n data samples {xi,yi}i=1,�,n. We usual.pdf
Question1) (20 points) Given n data samples {xi,yi}i=1,�,n. We usual.pdf
 
R. Allen Inc. R. Allen Inc. Income Statement Comparative Balance Shee.pdf
 R. Allen Inc. R. Allen Inc. Income Statement Comparative Balance Shee.pdf R. Allen Inc. R. Allen Inc. Income Statement Comparative Balance Shee.pdf
R. Allen Inc. R. Allen Inc. Income Statement Comparative Balance Shee.pdf
 
Question 7 (2 points) Refer to the below figure. There is a $75 milli.pdf
 Question 7 (2 points) Refer to the below figure. There is a $75 milli.pdf Question 7 (2 points) Refer to the below figure. There is a $75 milli.pdf
Question 7 (2 points) Refer to the below figure. There is a $75 milli.pdf
 
QUESTION 4 Part A Introduction In chromatography, solutes will follo.pdf
 QUESTION 4 Part A Introduction In chromatography, solutes will follo.pdf QUESTION 4 Part A Introduction In chromatography, solutes will follo.pdf
QUESTION 4 Part A Introduction In chromatography, solutes will follo.pdf
 
Question 4 A recent study focused on the number of times men and .pdf
 Question 4 A recent study focused on the number of times men and .pdf Question 4 A recent study focused on the number of times men and .pdf
Question 4 A recent study focused on the number of times men and .pdf
 
Question 4 ( 20 marks ) By relating it with the scenario in Malaysi.pdf
 Question 4 ( 20 marks ) By relating it with the scenario in Malaysi.pdf Question 4 ( 20 marks ) By relating it with the scenario in Malaysi.pdf
Question 4 ( 20 marks ) By relating it with the scenario in Malaysi.pdf
 
Question 4 4. Which of the following best defines the resource curse.pdf
 Question 4 4. Which of the following best defines the resource curse.pdf Question 4 4. Which of the following best defines the resource curse.pdf
Question 4 4. Which of the following best defines the resource curse.pdf
 
Question 12- Which of the following might suggest that a nurse.pdf
 Question 12- Which of the following might suggest that a nurse.pdf Question 12- Which of the following might suggest that a nurse.pdf
Question 12- Which of the following might suggest that a nurse.pdf
 

Dernier

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Dernier (20)

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Question 1 ( 40 points) The ATM can have three kinds of money units (.pdf

  • 1. Question 1 ( 40 points) The ATM can have three kinds of money units (fifties, twenties, and tens) Write a C+ ATM class to represent an ATM machine as the following (Separate header from implementation): (a) Define the private data members fifties, twenties and tens (Data type int for all of them) (4 points) b) A default constructor that initializes the fifties, twenties and tens to 0 ( 4 points) 4 c) An initializer constructor that receives values for fifties, twenties and tens. ( 4 points) d) Define a getter for fifties member variable. (4 points) (e) Define Deposit function that receives values for fifties, twenties and tens. The function should add the received fifties to the existing fifties, and so is the case for twenties and tens. For example, if the ATM machine has 4 fifties, 2 twenties, and 3 tens before Deposit, and we call Deposit (3,7,10), then the ATM should have 7 fifties (4+3),9 twenties (2+7), and 13 tens (3+10)(6 points) (f) Define int GetATMTotalCash0 member function that returns the total cash it has. (5 points) (8) Define bool HasMoreCash(ATM & a1) function which returns true if the current ATM has more balance that ATM al object received. (4 points) h) Define bool Withdraw(int amount,int &fifties_count,int &twenties_count, int &tens_count ) member function, it receives the amount of cash the customer wants to withdraw, and if successful it returns true and specify the number units it will return using (fifties_count, twenties_count, and tens_count). For example, if the ATM machine has 4 fifties, 2 twenties, and 3 tens before withdraw, and we call Withdraw (130,x,y,z), then the function should return true and make the ATM with 2 fifties (42),1 twenties (21), and 2 tens (31), and set x,y, and z to 2,1,1 which will be 2 fifties +1 twenty +1 ten which totals to 130. Moreover, for Withdraw (100,x,y,z), the function should return true and set x,y, z to 2,0,0. Note, the function would return false in case the transaction was not possible (for example Ino enough cash to return, or there is cash but existing money units will work such as requested to withdraw 140 when the ATM has only 3 fifties) ( 6 points)