Project Description Write a program that performs various unit conversions between metric and imperial systems. The...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Project Description Write a program that performs various unit conversions between metric and imperial systems. The program asks the user if he or she wants to convert one of the options below (the exact menu format is shown in the sample run below): 1. From feet and inches to meters and centimeters 2. From meters and centimeters to feet and inches 3. From pounds and ounces to kilograms and grams 4. From kilograms and grams to pounds and ounces The program then performs the desired conversion. Have the user respond by typing the integer (1,2,3, or 4) for the desired type of conversion. The program reads the user's answer and then executes a selection statement. Each branch of this selection statement will be a function call. Thus, you will need in your program at least four (4) functions. Also, include a loop that lets the user repeat this computation for new input values until the user says he or she wants to end the program. If the user requests an invalid option, the program displays a message and generates the same menu again. The demo at the end will show you some sample runs, to give a better (visual) clarification. The four functions that you must include in your code are: void ImperialToMetricL(); // requests English length measure, converts to metric, outputs both void Metric TolmperialL(); // request metric length measure, converts to English, outputs both void ImperialToMetricW(); // requests English mass measure, converts to metric, outputs both void MetricTolmperialW(); // request metric mass measure, converts to English, outputs both As you can see from the description of the functions above, they (each) perform several tasks, namely request (read input), convert, and output. Feel free to implement these sub tasks in separate functions. Important Tips You must follow the tips below to get a full mark: 1. Use meaningful identifier names (don't use int x and double y) 2. Use comments throughout your code and explain the purpose of each function 3. Use functions and minimize the amount of coding in your main function. Create at least the four functions mentioned above Useful Hints The imperial system is also known as the English or British measurement system. There are 0.3048 meters in a foot, 100 centimeters in a meter, and 12 inches in a foot. Since the metric system can naturally handle meters and centimeters as a real number, you can define it as a double value. For example, 1.75 meters is equal to 1 meter and 75 centimeters. There are 0.4536 kilogram in a pound, 1000 grams in a kilogram, and 16 ounces in a pound. Since the metric system can naturally handle kilograms and grams as a real number, you can define it as a double value. For example, 1.75 kilograms is equal to 1 kilogram and 750 grams. To make the program easier, we will assume the user can insert ounces value that is higher than a pound. For example, 1 pound and 20 ounces is an acceptable input, even though there is only 16 ounces in a pound. The same is applicable to the feet and inches. When converting, you should be careful that 2 pounds and 5 ounces is not 2.5 pounds. Grade Distribution When you submit your program include the code, a short report that lists and explains what kind of variables and functions you used, and screen shots of your output. Don't forget, you have to submit both electronic and printed copy of your work in order to get a grade. The 10 points will be distributed as follows: • Code: 7 Pts. o Comments, proper coding, variable naming and general layout (1 Pt.) o Properly displaying the menu and repeating it within a loop (2 Pts.) Project Description Write a program that performs various unit conversions between metric and imperial systems. The program asks the user if he or she wants to convert one of the options below (the exact menu format is shown in the sample run below): 1. From feet and inches to meters and centimeters 2. From meters and centimeters to feet and inches 3. From pounds and ounces to kilograms and grams 4. From kilograms and grams to pounds and ounces The program then performs the desired conversion. Have the user respond by typing the integer (1,2,3, or 4) for the desired type of conversion. The program reads the user's answer and then executes a selection statement. Each branch of this selection statement will be a function call. Thus, you will need in your program at least four (4) functions. Also, include a loop that lets the user repeat this computation for new input values until the user says he or she wants to end the program. If the user requests an invalid option, the program displays a message and generates the same menu again. The demo at the end will show you some sample runs, to give a better (visual) clarification. The four functions that you must include in your code are: void ImperialToMetricL(); // requests English length measure, converts to metric, outputs both void Metric TolmperialL(); // request metric length measure, converts to English, outputs both void ImperialToMetricW(); // requests English mass measure, converts to metric, outputs both void MetricTolmperialW(); // request metric mass measure, converts to English, outputs both As you can see from the description of the functions above, they (each) perform several tasks, namely request (read input), convert, and output. Feel free to implement these sub tasks in separate functions. Important Tips You must follow the tips below to get a full mark: 1. Use meaningful identifier names (don't use int x and double y) 2. Use comments throughout your code and explain the purpose of each function 3. Use functions and minimize the amount of coding in your main function. Create at least the four functions mentioned above Useful Hints The imperial system is also known as the English or British measurement system. There are 0.3048 meters in a foot, 100 centimeters in a meter, and 12 inches in a foot. Since the metric system can naturally handle meters and centimeters as a real number, you can define it as a double value. For example, 1.75 meters is equal to 1 meter and 75 centimeters. There are 0.4536 kilogram in a pound, 1000 grams in a kilogram, and 16 ounces in a pound. Since the metric system can naturally handle kilograms and grams as a real number, you can define it as a double value. For example, 1.75 kilograms is equal to 1 kilogram and 750 grams. To make the program easier, we will assume the user can insert ounces value that is higher than a pound. For example, 1 pound and 20 ounces is an acceptable input, even though there is only 16 ounces in a pound. The same is applicable to the feet and inches. When converting, you should be careful that 2 pounds and 5 ounces is not 2.5 pounds. Grade Distribution When you submit your program include the code, a short report that lists and explains what kind of variables and functions you used, and screen shots of your output. Don't forget, you have to submit both electronic and printed copy of your work in order to get a grade. The 10 points will be distributed as follows: • Code: 7 Pts. o Comments, proper coding, variable naming and general layout (1 Pt.) o Properly displaying the menu and repeating it within a loop (2 Pts.) o Implementing the required Functions correctly. You must have the four functions listed below with the same name (4 Pts.): void ImperialToMetricl(); // requests imperial length measure, converts to metric, outputs both void Metric TolmperialL(); // request metric length measure, converts to imperial, outputs both void ImperialToMetricW(); // requests imperial mass measure, converts to metric, outputs both void Metric TolmperialW(); // request metric mass measure, converts to imperial, outputs both 44 • Report (1.5 Pts.): Brief report that describes your approach in solving the problem, and lists what kind of variables and how many functions you used. • Output Screenshots (1.5 Pts.): At least one large screenshot that shows 4 conversion options. Notice that all these grades are linked to your ability to orally explain your code. Each group member should expect to be asked to explain, modify and run his or her code. Failing to do so will result in a zero. Sample Run (user input in red) Welcome to my units conversion program Please choose one of the options below: 1. Convert Imperial to Metric Length 2. Convert Metric to Imperial Length 3. Convert Imperial to Metric Mass 4. Convert Metric to Imperial Mass Invalid option Y or y allows another choice of conversion. any other quits y Welcome to my units conversion program Please choose one of the options below: 1. Convert Imperial to Metric Length 2. Convert Metric to Imperial Length 3. Convert Imperial to Metric Mass 4. Convert Metric to Imperial Mass 1 Enter feet as an integer: 2 Enter inches as a double: 11 0.89 meters corresponds to 2 feet, 11.00 inches Y or y allows another choice of conversion. any other quits y Welcome to my units conversion program Please choose one of the options below: 1. Convert Imperial to Metric Length 2. Convert Metric to Imperial Length 3. Convert Imperial to Metric Mass 4. Convert Metric to Imperial Mass 2 Enter a number of meters as a double 1.75 1.75 meters corresponds to 5 feet, 8.90 inches Yor y allows another choice of conversion. any other quits y Welcome to my units conversion program Please choose one of the options below: 1. Convert Imperial to Metric Length 2. Convert Metric to Imperial Length 3. Convert Imperial to Metric Mass 4. Convert Metric to Imperial Mass 3 Enter pounds as an integer: 2 Enter ounces as a double: 4 1.02 kilograms corresponds to 2 pounds, 4.00 ounces Y or y allows another choice of conversion. any other quits y Welcome to my units conversion program Please choose one of the options below: 1. Convert Imperial to Metric Length 2. Convert Metric to Imperial Length 3. Convert Imperial to Metric Mass 4. Convert Metric to Imperial Mass 4 Enter a number of kilograms as a double 3.75 3.75 kilograms corresponds to 8 pounds, 4.28 ounces Y or y allows another choice of conversion. any other quits n Thank You! Project Description Write a program that performs various unit conversions between metric and imperial systems. The program asks the user if he or she wants to convert one of the options below (the exact menu format is shown in the sample run below): 1. From feet and inches to meters and centimeters 2. From meters and centimeters to feet and inches 3. From pounds and ounces to kilograms and grams 4. From kilograms and grams to pounds and ounces The program then performs the desired conversion. Have the user respond by typing the integer (1,2,3, or 4) for the desired type of conversion. The program reads the user's answer and then executes a selection statement. Each branch of this selection statement will be a function call. Thus, you will need in your program at least four (4) functions. Also, include a loop that lets the user repeat this computation for new input values until the user says he or she wants to end the program. If the user requests an invalid option, the program displays a message and generates the same menu again. The demo at the end will show you some sample runs, to give a better (visual) clarification. The four functions that you must include in your code are: void ImperialToMetricL(); // requests English length measure, converts to metric, outputs both void Metric TolmperialL(); // request metric length measure, converts to English, outputs both void ImperialToMetricW(); // requests English mass measure, converts to metric, outputs both void MetricTolmperialW(); // request metric mass measure, converts to English, outputs both As you can see from the description of the functions above, they (each) perform several tasks, namely request (read input), convert, and output. Feel free to implement these sub tasks in separate functions. Important Tips You must follow the tips below to get a full mark: 1. Use meaningful identifier names (don't use int x and double y) 2. Use comments throughout your code and explain the purpose of each function 3. Use functions and minimize the amount of coding in your main function. Create at least the four functions mentioned above Useful Hints The imperial system is also known as the English or British measurement system. There are 0.3048 meters in a foot, 100 centimeters in a meter, and 12 inches in a foot. Since the metric system can naturally handle meters and centimeters as a real number, you can define it as a double value. For example, 1.75 meters is equal to 1 meter and 75 centimeters. There are 0.4536 kilogram in a pound, 1000 grams in a kilogram, and 16 ounces in a pound. Since the metric system can naturally handle kilograms and grams as a real number, you can define it as a double value. For example, 1.75 kilograms is equal to 1 kilogram and 750 grams. To make the program easier, we will assume the user can insert ounces value that is higher than a pound. For example, 1 pound and 20 ounces is an acceptable input, even though there is only 16 ounces in a pound. The same is applicable to the feet and inches. When converting, you should be careful that 2 pounds and 5 ounces is not 2.5 pounds. Grade Distribution When you submit your program include the code, a short report that lists and explains what kind of variables and functions you used, and screen shots of your output. Don't forget, you have to submit both electronic and printed copy of your work in order to get a grade. The 10 points will be distributed as follows: • Code: 7 Pts. o Comments, proper coding, variable naming and general layout (1 Pt.) o Properly displaying the menu and repeating it within a loop (2 Pts.) Project Description Write a program that performs various unit conversions between metric and imperial systems. The program asks the user if he or she wants to convert one of the options below (the exact menu format is shown in the sample run below): 1. From feet and inches to meters and centimeters 2. From meters and centimeters to feet and inches 3. From pounds and ounces to kilograms and grams 4. From kilograms and grams to pounds and ounces The program then performs the desired conversion. Have the user respond by typing the integer (1,2,3, or 4) for the desired type of conversion. The program reads the user's answer and then executes a selection statement. Each branch of this selection statement will be a function call. Thus, you will need in your program at least four (4) functions. Also, include a loop that lets the user repeat this computation for new input values until the user says he or she wants to end the program. If the user requests an invalid option, the program displays a message and generates the same menu again. The demo at the end will show you some sample runs, to give a better (visual) clarification. The four functions that you must include in your code are: void ImperialToMetricL(); // requests English length measure, converts to metric, outputs both void Metric TolmperialL(); // request metric length measure, converts to English, outputs both void ImperialToMetricW(); // requests English mass measure, converts to metric, outputs both void MetricTolmperialW(); // request metric mass measure, converts to English, outputs both As you can see from the description of the functions above, they (each) perform several tasks, namely request (read input), convert, and output. Feel free to implement these sub tasks in separate functions. Important Tips You must follow the tips below to get a full mark: 1. Use meaningful identifier names (don't use int x and double y) 2. Use comments throughout your code and explain the purpose of each function 3. Use functions and minimize the amount of coding in your main function. Create at least the four functions mentioned above Useful Hints The imperial system is also known as the English or British measurement system. There are 0.3048 meters in a foot, 100 centimeters in a meter, and 12 inches in a foot. Since the metric system can naturally handle meters and centimeters as a real number, you can define it as a double value. For example, 1.75 meters is equal to 1 meter and 75 centimeters. There are 0.4536 kilogram in a pound, 1000 grams in a kilogram, and 16 ounces in a pound. Since the metric system can naturally handle kilograms and grams as a real number, you can define it as a double value. For example, 1.75 kilograms is equal to 1 kilogram and 750 grams. To make the program easier, we will assume the user can insert ounces value that is higher than a pound. For example, 1 pound and 20 ounces is an acceptable input, even though there is only 16 ounces in a pound. The same is applicable to the feet and inches. When converting, you should be careful that 2 pounds and 5 ounces is not 2.5 pounds. Grade Distribution When you submit your program include the code, a short report that lists and explains what kind of variables and functions you used, and screen shots of your output. Don't forget, you have to submit both electronic and printed copy of your work in order to get a grade. The 10 points will be distributed as follows: • Code: 7 Pts. o Comments, proper coding, variable naming and general layout (1 Pt.) o Properly displaying the menu and repeating it within a loop (2 Pts.) o Implementing the required Functions correctly. You must have the four functions listed below with the same name (4 Pts.): void ImperialToMetricl(); // requests imperial length measure, converts to metric, outputs both void Metric TolmperialL(); // request metric length measure, converts to imperial, outputs both void ImperialToMetricW(); // requests imperial mass measure, converts to metric, outputs both void Metric TolmperialW(); // request metric mass measure, converts to imperial, outputs both 44 • Report (1.5 Pts.): Brief report that describes your approach in solving the problem, and lists what kind of variables and how many functions you used. • Output Screenshots (1.5 Pts.): At least one large screenshot that shows 4 conversion options. Notice that all these grades are linked to your ability to orally explain your code. Each group member should expect to be asked to explain, modify and run his or her code. Failing to do so will result in a zero. Sample Run (user input in red) Welcome to my units conversion program Please choose one of the options below: 1. Convert Imperial to Metric Length 2. Convert Metric to Imperial Length 3. Convert Imperial to Metric Mass 4. Convert Metric to Imperial Mass Invalid option Y or y allows another choice of conversion. any other quits y Welcome to my units conversion program Please choose one of the options below: 1. Convert Imperial to Metric Length 2. Convert Metric to Imperial Length 3. Convert Imperial to Metric Mass 4. Convert Metric to Imperial Mass 1 Enter feet as an integer: 2 Enter inches as a double: 11 0.89 meters corresponds to 2 feet, 11.00 inches Y or y allows another choice of conversion. any other quits y Welcome to my units conversion program Please choose one of the options below: 1. Convert Imperial to Metric Length 2. Convert Metric to Imperial Length 3. Convert Imperial to Metric Mass 4. Convert Metric to Imperial Mass 2 Enter a number of meters as a double 1.75 1.75 meters corresponds to 5 feet, 8.90 inches Yor y allows another choice of conversion. any other quits y Welcome to my units conversion program Please choose one of the options below: 1. Convert Imperial to Metric Length 2. Convert Metric to Imperial Length 3. Convert Imperial to Metric Mass 4. Convert Metric to Imperial Mass 3 Enter pounds as an integer: 2 Enter ounces as a double: 4 1.02 kilograms corresponds to 2 pounds, 4.00 ounces Y or y allows another choice of conversion. any other quits y Welcome to my units conversion program Please choose one of the options below: 1. Convert Imperial to Metric Length 2. Convert Metric to Imperial Length 3. Convert Imperial to Metric Mass 4. Convert Metric to Imperial Mass 4 Enter a number of kilograms as a double 3.75 3.75 kilograms corresponds to 8 pounds, 4.28 ounces Y or y allows another choice of conversion. any other quits n Thank You!
Expert Answer:
Answer rating: 100% (QA)
1 the required sourcecode is given below include using namespace std void Imperi... View the full answer
Related Book For
Posted Date:
Students also viewed these electrical engineering questions
-
1. Using switch statement, write a C program to do the following problems: [0.5 mark] A) If the user enters 1, the program prints the following structure using while loop: 1 22 333 4444 55555 B) If...
-
1. Using pointers write a C program that print the sum of an array element whose position is even. 2. Write a C program to insert string and then print it in reverse order. For example, given the...
-
Write a C program that does a large number of references to elements of two- dimensioned arrays, using only subscripting. Write a second program that does the same operations but uses pointers and...
-
Select the best response. What trend can be related to a major employer closing a business? Property values falling and people moving from a community. A rise in slips, trips and falls. New...
-
1. Who did the court side with? 2. What duty did Meinhard claim was breached? 3. Does fiduciary duty end when the partnership expires?
-
Suppose V = 0 and A = A0 sin(kx wt) y, where A0, w, and k are constants. Find E and B, and check that they satisfy Maxwell's equations in vacuum. What condition must you impose on w and k?
-
Assume the same information as in question 4. Also assume that beginning work in process had \($6,000\) in conversion cost and that \($84,000\) in conversion is added during this period. What is the...
-
Maureen Corporation estimated its overhead costs would be $30,000 per month except for January when it pays the $90,000 annual insurance premium on the manufacturing facility. Accordingly, the...
-
The figure depicts Jack - in - the - box: "Jack" is attached inside a box by a spring, as shown. You estimate Jack's mass to be 0 . 4 k g . As so often happens, a sign tells you the spring constant:...
-
The following table summarizes the operating results for Bene Petits first year of operations: Bene Petit First year operating data: Single (1 serving) Dual (2 servings) Family (4 servings) Total...
-
Rewrite the following expressions as a single logarithm. a. 6 log() 4 log(y) + log(2) log_10((x^6z)/y^4) Preview 1 b. 6 log(x) log(y) 4 log(z) 4 -- - log_10((x^6)/(^4sqrt(y)x^ * Preview c. log(x) ...
-
Compute Ms. Perez's preparer penalty if the IRS concludes that Ms. Perez intentionally disregarded the tax law by claiming the deduction in a willful attempt to understate Denver's tax. Compute Ms....
-
Now that you know what you want to present to an audience, it is important to fashion it into an active, engaging oral presentation. How you look, express yourself, and engage with your audience may...
-
Company JBY is asking your help in providing the management an idea how much is the Company's the cost of capital. After your initial meeting, you recommended to use Weighted Average Cost of Capital...
-
RANDLEMAN, N.C. -- The future of century-old bearing maker Timken Co. rests on an old axiom: The sum is greater than its parts. Examples fill the shelves of a squat, 10-year-old factory here crammed...
-
Question content area bottom Part 1 Included in Post-Closing Trial Balance? a. Office Supplies Y b. Interest Expense N c. Retained Earnings d. Dividends Y e. Service Revenue N f. Accumulated...
-
Use the given graph to determine the open intervals on which the function is either increasing, decreasing, or constant. Enter solutions using interval notation. If no interval exists where the...
-
You have accepted the engagement of auditing the financial statements of the C. Reis Company, a small manufacturing firm that has been your auditee for several years. Because you were busy writing...
-
Complete the C++ instructions column in Figure 3-24. Use the double data type for the input and output items. IPO chart information C++ instructions Input food rent utilties car payment Processing...
-
Create a program that allows the user to enter the ages (in years) of five people. The program should display the average age. Use the for statement. Display the average age with one decimal place....
-
In this exercise, you modify the highest number program from the chapter. If necessary, create a new project named ModifyThis20 Project and save it in the Cpp8\Chap11 folder. Enter the C++...
-
Novo Nordisk is a Denmark-based biopharmaceutical company with a focus on diabetes drugs. The company provides detailed disclosure of revenue along geographic, business segment, and product lines....
-
Use the data in Example 1 on Novo Nordisk to answer the following questions: i. Xiaoping Wu is an equity analyst covering European pharmaceutical companies for his clients in China. Wu projects that...
-
Walgreens and Rite Aid are two of the largest retail drugstore chains in the United States. For both companies, around two-thirds of their sales are from prescription pharmaceuticals, with the...
Study smarter with the SolutionInn App