Question
We will make a simple, menu-driven conversion software package, called English-Metric Converter. Our software package will present the user with a menu of choices and
We will make a simple, menu-driven conversion software package, called English-Metric Converter. Our software package will present the user with a menu of choices and execute the operation specified. The menu must look exactly like this:
English-Metric Converter 1) Convert from feet to meters 2) Convert from meters to feet 3) Compute area of a rectangle in square feet given length and width in meters 4) Compute volume of a rectangular solid in cubic meters given length, width, and height in feet 5) Quit the Program Please enter a number (1-5) ->
Implementation Notes: 1. You will create a function named menu() that will be called repeatedly from a loop in main(). 2. Function int menu() will show the alternatives as above and take user input (1 - 5), until a number on that range is entered. It will then return the legal user choice. 3. Inside a loop in main(), the program will repeatedly call menu(). When menu() returns a legal selection, code in main() will get all necessary inputs from the user, call the function that computes the result, and displays output. 4. The feet-to-meters and meters-to-feet functions should have one parameter (the input value) and a return value (the converted length). This means that you must get the length to be converted BEFORE calling the conversion function. Note that there are 0.3048 meters in a foot. 5. For the area problem, you are to get the length and width of the rectangle in meters, and pass them to a function. Inside the function, convert length and width to the new units using the other functions you have created for that purpose, and compute the area. Return the area to the caller. the caller will output the length, width, and area in meters and the area in square feet, properly labeled. Follow a similar approach for the volume problem (but obviously, with three parameters). 6. We will NOT know how many times the user will want to execute a function from the menu.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started