Chris Johanson wants a program that calculates and displays a 10%, 15%, and 20% tip on his total restaurant bill. First, create an IPO chart for this problem, and then desk-check the algorithm twice, using $35.80 and $56.78 as the total bill. After desk-checking the algorithm, list the input, processing, and output items in a chart similar to the one shown in Figure 3-23, and then enter the appropriate C++ declaration statements.
ANSWER
ANSWER
Program to calculate tip for the total bill.
#include
using namespace std;
using namespace std;
int main()
//reading inputs
double cupPrice,platePrice,cupsPurchased,platesPurchased,salesTax,totalBill;
cout
cin>>cupPrice;
cout
cin>>platePrice;
cout
cin>>cupsPurchased;
cout
cin>>platesPurchased;
cout
cin>>salesTax;
cout
cin>>totalBill;
// processing
double finalCost = (cupPrice*cupsPurchased)+(platePrice*platesPurchased)+totalBill;
finalCost = finalCost + (finalCost*salesTax*0.01);
//printing tips
cout <><>
cout <><>
cout <><>
return 0;
//reading inputs
double cupPrice,platePrice,cupsPurchased,platesPurchased,salesTax,totalBill;
cout
cin>>cupPrice;
cout
cin>>platePrice;
cout
cin>>cupsPurchased;
cout
cin>>platesPurchased;
cout
cin>>salesTax;
cout
cin>>totalBill;
// processing
double finalCost = (cupPrice*cupsPurchased)+(platePrice*platesPurchased)+totalBill;
finalCost = finalCost + (finalCost*salesTax*0.01);
//printing tips
cout
cout
cout
return 0;
OUTPUT
https://www.chegg.com/homework-help/questions-and-answers/writing-c-program-using-unions-create-union-floatingpoint-members-float-f-double-d-long-do-q16320911
ReplyDeletehttps://www.chegg.com/homework-help/questions-and-answers/question3-assume-two-parties-want-communicate--going-use-secret-way-communication-message--q34919359
ReplyDeletehttps://www.chegg.com/homework-help/questions-and-answers/write-program-design-starter-health-profile-structure-person-structure-s-members-include-p-q34918935
ReplyDeletehttps://www.chegg.com/homework-help/questions-and-answers/write-program-translate-english-alphabet-binary-strings-according-correspondence-store-res-q34919082
ReplyDelete