Question
Need JAVA code for this assignment Project Number II [after chapter 3] 1} Place this statement after the other import statement in your code import
Need JAVA code for this assignment
Project Number II [after chapter 3]
1} Place this statement after the other import statement in your code
import java.util.Scanner
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 inches to its corresponding value in centimeters.
It will convert an angle measurement from degrees to radians
Enter 1 for C to F
Enter 2 for in to cm
Enter 3 for degrees to radians
4) Scanner keyboard = new Scanner (System.in);
choice = keyboard.nextInt();
5) Test to make sure only a 1, 2 or 3 are entered i.e
If choice 3{
System.out.println ( Incorrect entry, please enter 1 , 2 or 3);
choice = keyboard.nextInt();
}
6) Use an if statement to test choice for a value of 1, and then execute the code for the temperature conversion.
7) Enclose the temperature code with braces tying it to the if statement
8) Use an if statement to test choice for a value of 2, and then execute the code for the conversion of inches to centimeters.
9) Enclose the inches to centimeters code with braces tying it to the if statement.
10) Use an if statement to test choice for a value of 3, then execute the code for the conversion of degrees to radians
11) Leave the exit statement outside the 3 if statement blocks of code.
12) Exit the program.
13) Place comments describing the set of steps that follow in the logic of the program.
14) Test the programs with a Celsius number. This will test the if logic
15) Test the program with an inches value. This will test the if logic.
16) Test the program with an angle value. This will test the if logic.
Celsius temperature = 5/0/9.0 times (Fahrenheit minus 32.0)
Fahrenheit= (9.0/5.0)*Celsius + 32.0
Centimeters= 2.54 times inches
Radians= Degrees times 3.14159 divided by 180.0
Project Number 2 1)Place this statement after the other import statement in your code "import java.util.Scanner" 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 1) it will convert celcisus temperature to its corresponding Fahrenheit temperature 2) it will convert a distance of inches to its corresponding value in centimeters 3) It will convert an angle measurement from degres to radians Enter for C to F Enter 2 for in to cm Enter 3 for degrees to radians" Scanner keyboard new Scanner (System.in); choice keyboard.nextlntO; Test to make sure only a 1, 2 or 3 are entered i.e Ifchoice 3f System.out.println (" Incorrect entry, please enter 1, 2 or 3"); 4) 5) choice -keyboard.nextlnt); 6) 7) Enclose the temperature code with braces tying it to the if statemernt 8) Use an if statement to test choice for a value of 1, and then execute the code for the temperature conversion Use an if statement to test choice for a value of 2, and then execute the code for the conversion of inches to centimeters Enclose the inches to centimeters code with braces tying it to the if statement 9) Use an if statement to test choice for a value of 3, then execute the code for the conversion of degrees to radians 11)Leave the exit statement outside the 3 if statement blocks of code 12) Exit the program 13)Place comments describing the set of steps that follow in the logic of the program 4) Test the programs with a Celcius number. This will test the if logic 15)Test the program with an inches value. This ill test the if logic 16) Test the program with an angle value. This will test the if logic Celsius temperature 5/0/9.0 times (Fahrenheit minus 32.0) Faherheit-9.0/5.0)*Celsius + 32.0 Centimeters 2.54 times inches Radians- Degrees times 3.14159 divided by 180.0Step 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