Question: C++ Program # 2 Folder: CPT 180 File Name: CPP-Project2.docx Project Number 2 [after chapter 4] 1} Place this statement after the other import statement
C++ Program # 2
Folder: CPT 180
File Name: CPP-Project2.docx
Project Number 2 [after chapter 4]
1} Place this statement after the other import statement in your code
#include
2) Define an integer named choice.
3) Use a System.out.println to print out a menu of this sort to the user
This program provides the following capabilities
it will convert Celsius temperature to its corresponding Fahrenheit temperature
it will convert a distance of centimeters to its corresponding value in inches.
It will convert an angle measurement from radians to degrees
It will convert Liters to Quarts
Enter 1 for Celsius to Fahrenheit
Enter 2 for centimeters to inches
Enter 3 for radians to degrees
Enter 4 for liters to quarts
4) cin >> choice;
choice = keyboard.nextInt();
5) Test to make sure only a 1, 2 or 3 are entered i.e
If choice < 1 || choice 4{
cout << Incorrect entry, please enter 1 , 2 , 3 or 4;
cin >>choice;
}
6) Use an if statement to test choice for a value of 1, and then execute the code for the temperature conversion.
7) Use an if statement to test choice for a value of 2, and then execute the code for the conversion of cm to in.
8) Use an if statement to test choice for a value of 3, then execute the code for the conversion of radians to degrees
9) Use an if statement to test choice for a value of 4, then execute the code for the conversion of liters to quarts
10) Leave the exit statement outside the 4 if statement blocks of code.
Faherheit=(9.0/5.0)*Celsius + 32.0
Centimeters= 2.54 times inches
Inches= centimeters divided by 2.54
degrees= radians times 180 divided by 3.14159
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
