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

Osmosis Data Sheet

Data Sheet: Activity - Osmosis Name Course Date Activity Data Code       Procedure I -Test Solution 1: Water Complete the tablesand questions below using your data and information found under the Background tab Data Table I Note: Difference in Final Volumes = Final Volume of Test Sol - Final Volume of Water Trial Starting Volume of Test Solution (L) Starting Volume of Water (L) Final Volume of Test Solution (L) Final Volume of Water (L) Difference in Final Volumes (L) 1 1.28 1.75 1.51 1.52 -0.01 2 1.28 2.00 1.64 1.64 0 Observations and Questions [1] Given that the final heights (and volumes) are the same for the water and test solution, what can you...

Pseudocode - painting a wall

My pseudocode from Module Two: Pseudocode – Painting a Wall MEASURE wall-length MEASURE wall width CALCULATE wall area DETERMINE amount of paint needed for wall-size PURCHASE desired paint and tools (brushes, rollers, pan, etc.) PREPARE work area and tools START painting wall END when painting is complete CLEAN work area and tools STORE tools and any leftover pa​‌‌‌‌‌‌‍‍‍‌‌‍‍‍‌‍‌‍‍​int
Simple Computer Science Questions Question 2 ANSWER Match the following a - 4 b - 10 c - 8 d - 6 e - 9 f - 1 g - 2 h - 7 i - 3 j - 5