Question: Each customer is identified by his name. This name should appear on the bill. Fees for the car wash are $4.25 with gasoline purchase of

Each customer is identified by his name. This name should appear on the bill. 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 name, number of gallons purchased, kind of gasoline purchased (R, U, P, or, for no purchase, N), and car wash desired (Y or N). Read data from a text file named customers.txt. Use named constants for gasoline prices and car wash fees. Copy and paste the following data into a new text file: customers.txt 6Joe Smith P 10.02 Y Mary Doe r 15.50 N Dan Retter U 19.00 y Victoria Beckham R 6.50 y Nick Parlante n 0 Y Viggo Mortensen p 18.27 N The first number represents the number of customers in the file. For each customer there are two lines in the file. The customers name is on the first line. The gas type (R, U, P, or N), followed by the number of gallons and Y or N for car wash are on the second line. We assume that the data in the input file has already been validated. // See next pageDisplay the output as shown below to another text file named gas_bill.txt. Be careful to align the decimal points. 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. Write to the screen the following: a welcome message, explaining what is the purpose of the program; the name of the input file; the number of customers and the name of the output file. ************************************* * Best Gas and Wash Service Station * ************************************* Customer: Joe Smith Gallons purchased: 10.02 Price per gallon : 3.65 Total gasoline cost: 36.57 Car wash cost: 4.25 ------ Total due: 40.82 ************************************* * Thank you for stopping! * * Have a nice day and * * come again! * ****************** ************************************* * Best Gas and Wash Service Station * ************************************* Customer: Mary Doe Gallons purchased: 15.50 Price per gallon : 3.39 ------ Total due: 52.55 ************************************* * Thank you for stopping! * * Have a nice day and * * come again! * ****************

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!