Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that displays the following menu: 1. Calculate the Area of a Circle 2. Calculate the tax based on user's input for an

Write a program that displays the following menu:

1. Calculate the Area of a Circle 2. Calculate the tax based on user's input for an item's price and tax rate 3. Convert pound to kilogram 4. Quit

Enter your choice (1-4):

If the user enters 1, the program should ask the user for their name and then it should ask for the radius of

the circle. Then the program should display (print) the user's name and the area of the circle limited to only two decimal points.

Input validation: Your program should ONLY accept positive numbers.

If the user enters 2, the program should ask the user's name, the price, and the tax rate. The program then should calculate the tax based on the price and print the user's name and the tax amount limited to only two decimal points.

Input validation: Your program should ONLY accept positive numbers.

If the user enters 3, the program should ask for user's name and the number of pound (lb). Your program should convert the pound into kilogram and print the user's name and the result in Kilogram limited to only two decimal points.

Input validation: Your program should ONLY accept positive numbers when accepting input for pounds

If the user enters 4, the program should quit.

Once done, the program should ask the user if they would like to repeat the program and should the user reply 'Y' or 'y' the program should display the menu and ask the user to make another choice using a do-while loop.

More Input Validation: Display an error message if the user enters a number outside the range of 1 through 4 or a char or a string when selecting an item from the menu.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions