Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Chapter Covered: Chapter 4 Concepts tested in this project - Selection control structure - The if statement - The switch statement - Relational operators and

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Chapter Covered: Chapter 4 Concepts tested in this project - Selection control structure - The if statement - The switch statement - Relational operators and logical operators - Use of relational and logical operators to check numeric ranges - User friendly - Use of user-friendly user prompt and simple input validation - Use of meaningful output labels and format - Use of output manipulators - Working with string type - Use of getline() Project Description There are two main systems for measuring distance, weight and temperature; the Imperial System of Measurement, and the Metric System of Measurement. Most countries use the Metric System, which uses the measuring units such as meters and grams and adds prefixes like kilo, milli and cent to count orders of magnitude. In the United States, we use the older Imperial system, where things are measured in feet, inches, and pounds. Write a program that shows the following menu options and lets the user to convert from Metric to Imperial system: Converter Toolkit 1. Temperature Converter 2. Distance Converter 3. Weight Converter 4. Quit - If the user enters 1 , the program should ask for the temperature in Celsius and convert it to Fahrenheit. - If the user enters 2, the program should ask for the distance in Kilometer and convert it to Mile. - If the user enters 3, the program should ask for the weight in Kilogram and convert it to Pound. - If the user enters 4 , the program should end. Project Specifications Input: - the user must enter a country name - the user must enter a number to select a menu option - the user must enter temperature in Celsius - the user must enter distance in Kilometer - the user must enter weight in Kilogram Input Validation: - Do not accept a number outside the ranqe of 1 through 4 for the menu option. - Do not accept negative numbers for distance and weight. - Be sure to display appropriate error message if the input is invalid. Output: The program should display the following: - a menu for Converter Toolkit - temperature in Fahrenheit, distance in miles or weight in pounds - a country name - Programmer's full name - project number - due date Processing Requirements 1. Use C++ constants to store all permanent data. 2. Don't use numbers of literals, such as 9,5,32. Instead use constants. 3. Your program should do all calculations using C++ expressions (Don't use calculators for any calculations) 4. The proqram should use a switch control structure 5. The program should use at least one selection control structure (if - else statement) 6. Be sure to convert as specified. For example, convert temperature from Celsius to Fahrenheit, not the other way around. 7. Do not use online conversion values, use the following for converting input: - 1 kilometer =0.6 mile, - 1 kilogram =2.2 pounds, - The formula for converting Celsius degree to Fahrenheit is: F=(9/5)C+32 where F is the temperature in Fahrenheit and C is the temperature in Celsius 8. After conversion display result using the following format: - temperature to a whole number; for example, 78 - distance to two positions after decimal point; for example, 84.56 - weiqht to one position after decimal point; for example, 121.6. General Requirements: - Include the following in your code in C++ source .cpp: - Program Header: All programming projects' source code need to have one block comment at the top of the program containing the course name and CRN, the project number, your name, project description, and the due date. Provide any additional comments as necessary to clarify the program. Sample Screen Output \#1: Enter a country name: United Kingdom Converter Toolkit 1. Temperature Converter 2. Distance Converter 3. Weight Converter 4. Quit Enter your choice (14):1 Please enter temperature in Celsius (such as 24): 20 It is 68 in Fahrenheit. United Kingdom sounds fun! Thank you for testing my program!! PROGRAMMER: Tina Lee CMSC14e Common Project 2 Due Date: 9/24/2018 Sample Screen Output \#2: Enter a country name: United Kingdom Converter Toolkit 1. Temperature Converter 2. Distance Converter 3. Weight Converter 4. Quit Enter your choice (1-4): 2 Please enter distance in Kilometer (such as 18.54): 8 1!! Program does not convert negative distance |!! United Kingdom sounds fun! Thank you for testing my program!! PROGRAMMER: Tina Lee CMSC140 Common Project 2 Due Date: 9/24/2e18 Test your program with at least two more test cases. Use the given data as an example. Record your data for input and output in the following table. Make sure your tests cover all the possible scenarios. A good test plan should be comprehensive. This means you should have a few test cases that test when the input is out of range, division by 0 , etc. For example: Input validation requirements: Display an error message if the user enters for example: a number outside the range of 1 through 4 when selecting an item from the menu. No negative values accepted for the circle's radius. You should add at least three cases: Case 1: Check program if user enters a number out of range: 0 Case 2: Check program if user enters a number out of range: 5 Case 3: Check program if user enters a negative radius: 2

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_2

Step: 3

blur-text-image_3

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students explore these related Databases questions

Question

What Is acidity?

Answered: 3 weeks ago

Question

Explain the principles of delegation

Answered: 3 weeks ago

Question

State the importance of motivation

Answered: 3 weeks ago