SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
Part 2: Tip Calculator Problem Statement: You're out to eat with friends and want to split the
bill, but you're not sure how much to tip. Write a C++ program that calculates the tip amount
based on the total bill and the number of people splitting the bill. The program should prompt the
user to input the following information: 1. The total bill amount 2. The number of people
splitting the bill 3. Tip percentage The program should then calculate the recommended tip and
the total amount owed by each person. The program should output the following information: 1.
The total bill amount 2. Tip amount 3. Total amount owed by each person At the end of each
calculation, the user should be asked if they want to do another calculation or exit the program.
The program must handle all types of bad inputs from user and recover from the errors. Example
run: (User inputs are highlighted!) Enter the total bill amount: 4 fdd 555 Invalid input! Bill
amount must be a float/double! Enter the total bill amount: 150.88 Enter the number of people
splitting the bill: 5.6 Invalid input! Number of people must be a positive integer! Enter the
number of people splitting the bill: 0 Invalid input! Number of people must be a positive integer!
Enter the number of people splitting the bill: 8 Enter the tip percentage, between 1 to 100 (i.e.,
for 15% , enter 15 ): 15 Total bill amount: $150.88 Tip amount: $22.63 ( 15% ) Total amount
owed by each person: $21.69 Do you want to do another calculation? (0-no, 1-yes): 0 Required
function(s): Your program must involve the following functions. You may not change the
parameters or the return type!!! //a function to get bill amount from the user double get_bill();
OR void get_bill (double& bill_amount); //a function to calculate the tip amount double
calculate_tip (double bill_amount, double tip_percentage); OR void calculate_tip (double
bill_amount, double tip_percentage, double& tip);

Más contenido relacionado

Similar a Part 2- Tip Calculator Problem Statement- You're out to eat with frien.pdf

INT213 Project Report: Income Tax Calculator
INT213 Project Report: Income Tax CalculatorINT213 Project Report: Income Tax Calculator
INT213 Project Report: Income Tax CalculatorQazi Maaz Arshad
 
As with all projects in this course, your program’s output wil.docx
As with all projects in this course, your program’s output wil.docxAs with all projects in this course, your program’s output wil.docx
As with all projects in this course, your program’s output wil.docxrandymartin91030
 
Accenture fico interview-questions
Accenture fico interview-questionsAccenture fico interview-questions
Accenture fico interview-questionsprabhakar vanam
 
Advanced Computer Programming..pptx
Advanced Computer Programming..pptxAdvanced Computer Programming..pptx
Advanced Computer Programming..pptxKrishanthaRanaweera1
 
Cfa level 1 quantitative analysis e book part 1
Cfa level 1 quantitative analysis e book   part 1Cfa level 1 quantitative analysis e book   part 1
Cfa level 1 quantitative analysis e book part 1parmanandiskool
 

Similar a Part 2- Tip Calculator Problem Statement- You're out to eat with frien.pdf (6)

INT213 Project Report: Income Tax Calculator
INT213 Project Report: Income Tax CalculatorINT213 Project Report: Income Tax Calculator
INT213 Project Report: Income Tax Calculator
 
As with all projects in this course, your program’s output wil.docx
As with all projects in this course, your program’s output wil.docxAs with all projects in this course, your program’s output wil.docx
As with all projects in this course, your program’s output wil.docx
 
Accenture fico interview-questions
Accenture fico interview-questionsAccenture fico interview-questions
Accenture fico interview-questions
 
Advanced Computer Programming..pptx
Advanced Computer Programming..pptxAdvanced Computer Programming..pptx
Advanced Computer Programming..pptx
 
Cfa level 1 quantitative analysis e book part 1
Cfa level 1 quantitative analysis e book   part 1Cfa level 1 quantitative analysis e book   part 1
Cfa level 1 quantitative analysis e book part 1
 
Log in system
Log in systemLog in system
Log in system
 

Más de arcellzone

package ex2- public class Exercise2-E- { private static class N.pdf
package ex2- public class Exercise2-E- {        private static class N.pdfpackage ex2- public class Exercise2-E- {        private static class N.pdf
package ex2- public class Exercise2-E- { private static class N.pdfarcellzone
 
Part A List five 21st Century Skills you need to develop- Part B Ass.pdf
Part A List five 21st Century Skills you need to develop-   Part B Ass.pdfPart A List five 21st Century Skills you need to develop-   Part B Ass.pdf
Part A List five 21st Century Skills you need to develop- Part B Ass.pdfarcellzone
 
Part 5- Use the 105CLl to Gather Device Information (10 points) Issue.pdf
Part 5- Use the 105CLl to Gather Device Information (10 points) Issue.pdfPart 5- Use the 105CLl to Gather Device Information (10 points) Issue.pdf
Part 5- Use the 105CLl to Gather Device Information (10 points) Issue.pdfarcellzone
 
Part 8- Use the simplified sum-of-minterms expressions to generate the (1).pdf
Part 8- Use the simplified sum-of-minterms expressions to generate the (1).pdfPart 8- Use the simplified sum-of-minterms expressions to generate the (1).pdf
Part 8- Use the simplified sum-of-minterms expressions to generate the (1).pdfarcellzone
 
Part 2- Character -- Reminder- all data objects should have getters an.pdf
Part 2- Character -- Reminder- all data objects should have getters an.pdfPart 2- Character -- Reminder- all data objects should have getters an.pdf
Part 2- Character -- Reminder- all data objects should have getters an.pdfarcellzone
 
Part 1- Research the Importance of an IT Asset Inventory Conduct an in.pdf
Part 1- Research the Importance of an IT Asset Inventory Conduct an in.pdfPart 1- Research the Importance of an IT Asset Inventory Conduct an in.pdf
Part 1- Research the Importance of an IT Asset Inventory Conduct an in.pdfarcellzone
 
Part 2 Water Trace a molecule of water from the renal artery to the re.pdf
Part 2 Water Trace a molecule of water from the renal artery to the re.pdfPart 2 Water Trace a molecule of water from the renal artery to the re.pdf
Part 2 Water Trace a molecule of water from the renal artery to the re.pdfarcellzone
 
Part 2 1- Create a list of all the IP addresses used to attempt to log.pdf
Part 2 1- Create a list of all the IP addresses used to attempt to log.pdfPart 2 1- Create a list of all the IP addresses used to attempt to log.pdf
Part 2 1- Create a list of all the IP addresses used to attempt to log.pdfarcellzone
 
Part 11 atratighisini and youngist will the in lith- thery are fiponit.pdf
Part 11 atratighisini and youngist will the in lith- thery are fiponit.pdfPart 11 atratighisini and youngist will the in lith- thery are fiponit.pdf
Part 11 atratighisini and youngist will the in lith- thery are fiponit.pdfarcellzone
 
Parsing food data lab - Please answer in JAVA Given a text file contai.pdf
Parsing food data lab - Please answer in JAVA Given a text file contai.pdfParsing food data lab - Please answer in JAVA Given a text file contai.pdf
Parsing food data lab - Please answer in JAVA Given a text file contai.pdfarcellzone
 
Paris Just Got Cheaper for American Tourists Paris- France- Americans.pdf
Paris Just Got Cheaper for American Tourists Paris- France- Americans.pdfParis Just Got Cheaper for American Tourists Paris- France- Americans.pdf
Paris Just Got Cheaper for American Tourists Paris- France- Americans.pdfarcellzone
 
Parent generation Cross-fertilization F1 generation F2 generationRead.pdf
Parent generation Cross-fertilization F1 generation F2 generationRead.pdfParent generation Cross-fertilization F1 generation F2 generationRead.pdf
Parent generation Cross-fertilization F1 generation F2 generationRead.pdfarcellzone
 
Paf is a small country- Its currency is the pif- and the exchange rate.pdf
Paf is a small country- Its currency is the pif- and the exchange rate.pdfPaf is a small country- Its currency is the pif- and the exchange rate.pdf
Paf is a small country- Its currency is the pif- and the exchange rate.pdfarcellzone
 
package linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdfpackage linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdfarcellzone
 
package hw1-public class Runner { public static void main(String-- arg (1).pdf
package hw1-public class Runner { public static void main(String-- arg (1).pdfpackage hw1-public class Runner { public static void main(String-- arg (1).pdf
package hw1-public class Runner { public static void main(String-- arg (1).pdfarcellzone
 
P1) Given the Von Neumann architecture- answer the following questions.pdf
P1) Given the Von Neumann architecture- answer the following questions.pdfP1) Given the Von Neumann architecture- answer the following questions.pdf
P1) Given the Von Neumann architecture- answer the following questions.pdfarcellzone
 
P1) Answer the following questions (a) We discussed about bottleneck i.pdf
P1) Answer the following questions (a) We discussed about bottleneck i.pdfP1) Answer the following questions (a) We discussed about bottleneck i.pdf
P1) Answer the following questions (a) We discussed about bottleneck i.pdfarcellzone
 
P1) Answer the following questions ( 40 points) (a) We discussed about.pdf
P1) Answer the following questions ( 40 points) (a) We discussed about.pdfP1) Answer the following questions ( 40 points) (a) We discussed about.pdf
P1) Answer the following questions ( 40 points) (a) We discussed about.pdfarcellzone
 
Our Space is a social media site that is growing in popularity- The fi.pdf
Our Space is a social media site that is growing in popularity- The fi.pdfOur Space is a social media site that is growing in popularity- The fi.pdf
Our Space is a social media site that is growing in popularity- The fi.pdfarcellzone
 
P(Zn-kZn1-j)-k!(j)kej (5 points) Let T be the minimal value of n such.pdf
P(Zn-kZn1-j)-k!(j)kej (5 points) Let T be the minimal value of n such.pdfP(Zn-kZn1-j)-k!(j)kej (5 points) Let T be the minimal value of n such.pdf
P(Zn-kZn1-j)-k!(j)kej (5 points) Let T be the minimal value of n such.pdfarcellzone
 

Más de arcellzone (20)

package ex2- public class Exercise2-E- { private static class N.pdf
package ex2- public class Exercise2-E- {        private static class N.pdfpackage ex2- public class Exercise2-E- {        private static class N.pdf
package ex2- public class Exercise2-E- { private static class N.pdf
 
Part A List five 21st Century Skills you need to develop- Part B Ass.pdf
Part A List five 21st Century Skills you need to develop-   Part B Ass.pdfPart A List five 21st Century Skills you need to develop-   Part B Ass.pdf
Part A List five 21st Century Skills you need to develop- Part B Ass.pdf
 
Part 5- Use the 105CLl to Gather Device Information (10 points) Issue.pdf
Part 5- Use the 105CLl to Gather Device Information (10 points) Issue.pdfPart 5- Use the 105CLl to Gather Device Information (10 points) Issue.pdf
Part 5- Use the 105CLl to Gather Device Information (10 points) Issue.pdf
 
Part 8- Use the simplified sum-of-minterms expressions to generate the (1).pdf
Part 8- Use the simplified sum-of-minterms expressions to generate the (1).pdfPart 8- Use the simplified sum-of-minterms expressions to generate the (1).pdf
Part 8- Use the simplified sum-of-minterms expressions to generate the (1).pdf
 
Part 2- Character -- Reminder- all data objects should have getters an.pdf
Part 2- Character -- Reminder- all data objects should have getters an.pdfPart 2- Character -- Reminder- all data objects should have getters an.pdf
Part 2- Character -- Reminder- all data objects should have getters an.pdf
 
Part 1- Research the Importance of an IT Asset Inventory Conduct an in.pdf
Part 1- Research the Importance of an IT Asset Inventory Conduct an in.pdfPart 1- Research the Importance of an IT Asset Inventory Conduct an in.pdf
Part 1- Research the Importance of an IT Asset Inventory Conduct an in.pdf
 
Part 2 Water Trace a molecule of water from the renal artery to the re.pdf
Part 2 Water Trace a molecule of water from the renal artery to the re.pdfPart 2 Water Trace a molecule of water from the renal artery to the re.pdf
Part 2 Water Trace a molecule of water from the renal artery to the re.pdf
 
Part 2 1- Create a list of all the IP addresses used to attempt to log.pdf
Part 2 1- Create a list of all the IP addresses used to attempt to log.pdfPart 2 1- Create a list of all the IP addresses used to attempt to log.pdf
Part 2 1- Create a list of all the IP addresses used to attempt to log.pdf
 
Part 11 atratighisini and youngist will the in lith- thery are fiponit.pdf
Part 11 atratighisini and youngist will the in lith- thery are fiponit.pdfPart 11 atratighisini and youngist will the in lith- thery are fiponit.pdf
Part 11 atratighisini and youngist will the in lith- thery are fiponit.pdf
 
Parsing food data lab - Please answer in JAVA Given a text file contai.pdf
Parsing food data lab - Please answer in JAVA Given a text file contai.pdfParsing food data lab - Please answer in JAVA Given a text file contai.pdf
Parsing food data lab - Please answer in JAVA Given a text file contai.pdf
 
Paris Just Got Cheaper for American Tourists Paris- France- Americans.pdf
Paris Just Got Cheaper for American Tourists Paris- France- Americans.pdfParis Just Got Cheaper for American Tourists Paris- France- Americans.pdf
Paris Just Got Cheaper for American Tourists Paris- France- Americans.pdf
 
Parent generation Cross-fertilization F1 generation F2 generationRead.pdf
Parent generation Cross-fertilization F1 generation F2 generationRead.pdfParent generation Cross-fertilization F1 generation F2 generationRead.pdf
Parent generation Cross-fertilization F1 generation F2 generationRead.pdf
 
Paf is a small country- Its currency is the pif- and the exchange rate.pdf
Paf is a small country- Its currency is the pif- and the exchange rate.pdfPaf is a small country- Its currency is the pif- and the exchange rate.pdf
Paf is a small country- Its currency is the pif- and the exchange rate.pdf
 
package linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdfpackage linkedLists- import java-util-Iterator- --- A class representi.pdf
package linkedLists- import java-util-Iterator- --- A class representi.pdf
 
package hw1-public class Runner { public static void main(String-- arg (1).pdf
package hw1-public class Runner { public static void main(String-- arg (1).pdfpackage hw1-public class Runner { public static void main(String-- arg (1).pdf
package hw1-public class Runner { public static void main(String-- arg (1).pdf
 
P1) Given the Von Neumann architecture- answer the following questions.pdf
P1) Given the Von Neumann architecture- answer the following questions.pdfP1) Given the Von Neumann architecture- answer the following questions.pdf
P1) Given the Von Neumann architecture- answer the following questions.pdf
 
P1) Answer the following questions (a) We discussed about bottleneck i.pdf
P1) Answer the following questions (a) We discussed about bottleneck i.pdfP1) Answer the following questions (a) We discussed about bottleneck i.pdf
P1) Answer the following questions (a) We discussed about bottleneck i.pdf
 
P1) Answer the following questions ( 40 points) (a) We discussed about.pdf
P1) Answer the following questions ( 40 points) (a) We discussed about.pdfP1) Answer the following questions ( 40 points) (a) We discussed about.pdf
P1) Answer the following questions ( 40 points) (a) We discussed about.pdf
 
Our Space is a social media site that is growing in popularity- The fi.pdf
Our Space is a social media site that is growing in popularity- The fi.pdfOur Space is a social media site that is growing in popularity- The fi.pdf
Our Space is a social media site that is growing in popularity- The fi.pdf
 
P(Zn-kZn1-j)-k!(j)kej (5 points) Let T be the minimal value of n such.pdf
P(Zn-kZn1-j)-k!(j)kej (5 points) Let T be the minimal value of n such.pdfP(Zn-kZn1-j)-k!(j)kej (5 points) Let T be the minimal value of n such.pdf
P(Zn-kZn1-j)-k!(j)kej (5 points) Let T be the minimal value of n such.pdf
 

Último

psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
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
 
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
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 

Último (20)

psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
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
 
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
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

Part 2- Tip Calculator Problem Statement- You're out to eat with frien.pdf

  • 1. Part 2: Tip Calculator Problem Statement: You're out to eat with friends and want to split the bill, but you're not sure how much to tip. Write a C++ program that calculates the tip amount based on the total bill and the number of people splitting the bill. The program should prompt the user to input the following information: 1. The total bill amount 2. The number of people splitting the bill 3. Tip percentage The program should then calculate the recommended tip and the total amount owed by each person. The program should output the following information: 1. The total bill amount 2. Tip amount 3. Total amount owed by each person At the end of each calculation, the user should be asked if they want to do another calculation or exit the program. The program must handle all types of bad inputs from user and recover from the errors. Example run: (User inputs are highlighted!) Enter the total bill amount: 4 fdd 555 Invalid input! Bill amount must be a float/double! Enter the total bill amount: 150.88 Enter the number of people splitting the bill: 5.6 Invalid input! Number of people must be a positive integer! Enter the number of people splitting the bill: 0 Invalid input! Number of people must be a positive integer! Enter the number of people splitting the bill: 8 Enter the tip percentage, between 1 to 100 (i.e., for 15% , enter 15 ): 15 Total bill amount: $150.88 Tip amount: $22.63 ( 15% ) Total amount owed by each person: $21.69 Do you want to do another calculation? (0-no, 1-yes): 0 Required function(s): Your program must involve the following functions. You may not change the parameters or the return type!!! //a function to get bill amount from the user double get_bill(); OR void get_bill (double& bill_amount); //a function to calculate the tip amount double calculate_tip (double bill_amount, double tip_percentage); OR void calculate_tip (double bill_amount, double tip_percentage, double& tip);