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

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

IT management

FIGURE P1.1 The File Structure for Problems 1-4 1.       How many records does the file contain? How many fields are there per record? 2.       What problem would you encounter if you wanted to produce a listing by city? How would you solve this problem by altering the file structure? 3.       If you wanted to produce a listing of the file contents by last name, area code, city, state, or zip code, how would you alter the file structure? 4.       What data redundancies do you detect? How could those redundancies lead to anomalies? Figure P2.4 The DealCo relational diagram 4. Identify each relationship type and write all of the business rules. 5.       Create the basic Crow’s Foot ERD for DealCo. FIGURE P3.17 The Ch03_TransCo Database Tables     17. For each table, identify the primary key and the for...

Freelance Writing

We have top rated writers to help you with your assignments... Get your assignments/orders done. Work Types Essay Article Argumentive essay Coursework Dissertation Thesis Editing Proofreading Case study Lab report Problem-solving Multiple-choice questions Powerpoint presentation Critical thinking Short story Assignment Speaker notes 1-page summary Poster Speech Referencing styles APA MLA Chicago Harvard Vancouver Oxford CSE Others How to post the question/problem?? Comment/Mail : Subject Academic level (High-school/Undergraduate/Postgraduate/Master/PhD/....) Style (APA/MLA/Harvard/..........) Language (English US/UK) Order type (essay/thesis/lab report/...........) Number of pages and sources required Deadline Number of pages Compensation that you are ready to offer