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...
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
Question: 7. A circular cam 200 mm in diameter rotates off centre with an eccentricity of 25 mm and operates the roller follower that is carried by the arm as shown in Fig. 23.35. ???200 mm +100mm- Spring 25 mm Fig. 23.35 The roller follower is held against the cam by means of an extension spring. Assuming that the force between the follower and the cam is approximately 250 N at the low position and 400 N at the high position. If the spring index is 7, find the diameter of wire, outside diameter of spring and the number of active coils. The maximum shear stress may be taken as 280 MPa. Use G 80 kN/mm2 ANSWER