Develop a c program that uses a while loop to input the


Text Exercise 4.13 (Gas Mileage)

• Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several trips by recording miles driven and gallons used for each trip. Develop a C++ program that uses a while loop to input the miles driven and gallons used for each trip. The program should calculate and display the miles per gallon obtained for each trip and print the combined miles per gallon for all tankfuls up to this point.

• Miles driven and gallons used are to be doubles. See sample output in text.

Text Exercise 4.14 (Credit Limits)

• Develop a C++ program that will determine whether a department-store customer has exceeded the credit limit on a charge account. For each customer, the following facts are to be input by the user:
• Account number (an integer)
• Balance at the beginning of the month
• Total of all items charged this month by the customer
• Total of all credits applied to the customers account this month
• Allowed credit limit
• The program should use a while loop to input each of these facts, calculate and display the new balance (= beginning balance + charges - credits) and determine whether the new balance exceeds the customer's credit limit. For those customers whose credit limits is exceeded, the program should display the customer's account number, credit limit, new balance, and the message "Credit Limit Exceeded."

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Develop a c program that uses a while loop to input the
Reference No:- TGS01600197

Now Priced at $50 (50% Discount)

Recommended (95%)

Rated (4.7/5)