Question: 4. Write a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the

4. Write a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, then calculate the amounts of a 18 percent tip and 7 percent sales tax. Display each of these amounts and the total. Enter the charge for food: 150 Tip: $ 27.00 Tax: $ 10.50 Total: $ 187.50 5- Write a program that asks user to enter distance in meters, then display how many kilometer and meter in the input value. (KM=1000 m) Enter the distance in meters: 2350 Kilometer: 2 Meter: 350 6- Write a program that asks the user to type in a time in seconds and display it in the standard format hours:minutes:seconds (where 1 hour = 3600 seconds and 1 minute = 60 seconds). Your output should look similar to this: Enter time in seconds: 3725 Time is: 1 : 2 : 5 1- Write a program that asks the user to enter the radius of a circle. The program should calculate and display the area and circumference of the circle using rt r2 for the area and 2 t r for the circumference. Hint: You can either use 3.14159 as the value of pi (20) Your output should be like the one below (use format to display two digits after the decimal point. Enter radius of circle: 4 Area of circle: 50.27 Circumference of circle: 25.13 2- One pound is equivalent to 0.454 kilograms. Write a program that asks the user to enter the mass of an object in pounds and then calculates and displays the mass of the object in kilograms. Enter a value in pounds: 5 5 pounds is 2.27 kilograms. 3- A customer in a store is purchasing five items. Write a program that asks for the price of each item, then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 7 percent. Enter the price of item #1: 3 Enter the price of item #2: 6 Enter the price of item #3: 2 Enter the price of item #4: 5 Enter the price of item #5: 4.5 Subtotal: 20.50 Sales Tax: 1.44 Total: 21.93
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
