Skip to main content
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



Program to calculate tip for the total bill.
#include
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;

OUTPUT

Comments

  1. 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

    ReplyDelete
  2. https://www.chegg.com/homework-help/questions-and-answers/question3-assume-two-parties-want-communicate--going-use-secret-way-communication-message--q34919359

    ReplyDelete
  3. https://www.chegg.com/homework-help/questions-and-answers/write-program-design-starter-health-profile-structure-person-structure-s-members-include-p-q34918935

    ReplyDelete
  4. https://www.chegg.com/homework-help/questions-and-answers/write-program-translate-english-alphabet-binary-strings-according-correspondence-store-res-q34919082

    ReplyDelete

Post a Comment

Popular posts from this blog

Need answers for your academic questions?

Need answers for your academic questions? Ask them in the comment section below. Just type in the url link of your question in the comment section below. And get your answer ready in two formats. Hand written Screenshot We will post the answer as soon as we get them (questions) Thank you..
Question: prove by induction 2^2 + 4^2 + 6^2 + ... + (2n)^2 = (2n)(2n+1)(2n+2)/6 ANSWER we will use induction on n base case : n=1 we have, 2^2 = 2*3*4/6 = 4 which is true inductive hypothesis let it be true for n = k i.e.,  2^2 + 4^2 + ... + (2k)^2 =   [(2k)(2k+1)(2k+2)]/6 inductive case let n = k+1 then we have 2^2 + 4^2 + .... + (2k)^2 + (2(k+1))^2 =   [(2k)(2k+1)(2k+2)]/6 + (2k+2)^2 =(2k+2)*[(2k)(2k+1)/6 + (2k+2)] =(2k+2)*[ (4k^2+2k)/6 + (12k + 12)/6 ] =(2k+2)*[ (4k^2+14k+12)/6 ] = =(2k+2)*[(2k)(2k+1)/6 + (2k+2)] =(2k+2)*[ (4k^2+2k)/6 + (12k + 12)/6 ] =(2k+2)*[ (4k^2+14k+12)/6 ] = (2k+2)*[ (4k^2 + 8k + 6k + 12)/6 ] = (2k+2)*[ (4k(k + 2) +6(k+2))/6 ] = (2k+2)*[ (4k+6)(k+2)/6 ] =  (2k+2)*[ 2 (2k+3)(k+2)/6  ] =   (2k+2)*[  (2k+3)*2*(k+2)/6  ] =   (2k+2)*[  (2k+3)(2k+4)/6  ] = [(2*(k+1))(2*(k+1)+1)(2*(k+1)+2)]/6 replacing k+1 by m, we get replacing k+1 by m, we get [(2*m)(2*m+1)(2*m+2)]/6 this completes our proof b...

Get assignments and case studies solved...

Hey Guys! Checkout our new site, https://caseaments.blogspot.com/  , where you can get your assignments done at low rate. Just send us the assignment topic. Specify, what you all need, summary or step by step writing. Give us a dead-line and length of assignment. ( number of words) On the basis of that, you will be charged. Any subject, even you can send us case studies , and get them answered. Payment methods: PayPal Payoneer Mail us at earnwithmetoo@gmail.com with the above details for quick response. Or else, join Hangouts . email-id  earnwithmetoo@gmail.com