Question: I have a code set up, but I am stuck trying to fix it with the if/else statements. I would appreciate if I could compare

I have a code set up, but I am stuck trying to fix it with the "if/else" statements. I would appreciate if I could compare my code with another person's. Thanks.

Edit: It is asking to be done in C++ language.

I have a code set up, but I am stuck trying to

Note:

fix it with the "if/else" statements. I would appreciate if I couldcompare my code with another person's. Thanks. Edit: It is asking to

Project: Calculate the amount a customer should be charged at a gas station. Fees for the car wash are $4.25 with gasoline purchase of $35.00 or more and $10.00 otherwise. Three kinds of gasoline are available: regular at 3.39, unleaded at 3.55 and premium at 3.65 per gallon. Input consists of the customer number, number of gallons purchased, kind of gasoline purchased (R, U, P, or, for no purchase, N), and car wash desired (Y or N). You are in charge of completely testing the program. Do not forget to include input validation for incorrect values. Run your program at least six times with the test data shown below for gas type, gallons, and car wash in this order: 1. P. 10.02 15.50 3. U 19.00 4. R 6.50 5. n 6. N r The program is to prompt the user for the input as shown below: Gas type (R, U, P, N) : P Number of gallons : 10.02 Car wash? [Y/N] : Y If the user chooses gas type: 'N', the number of gallons should be set to 0. Write the bill to an output file as shown below. Be careful to align the decimal points. Prompt the user to enter the name of the output file. *********** *********** ************ ** * * Best Gas and Wash Service Station * * ** ** ************************ ********* Gallons purchased: Price per gallon : 10.02 3.23 Total gasoline cost: 32.36 Car wash cost: 3.25 ----- - Total due: 35.61 ************* ************************ * Thank you for stopping! * Have a nice day * and * come again! * ** *********** ***** Here is another example: ** ********* ** ************* *********** * * * * Best Gas and Wash Service Station ************* ************************ * * Gallons purchased: Price per gallon : 15.50 3.01 Total due: 46.66 ** *********************************** * * * Thank you for stopping! Have a nice day and * come again! * **** * ************* * Notice that when the customer chooses not to wash the car, the car wash cost is not displayed on the bill. If the user chooses gas type: 'N', and car wash 'Y' then display only the second part of the bill. If the user decides to leave without any service, print just a message (i.e. do not print an empty bill)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!