Question: Edit the Program: Temperature to ask the user to continue by typing 'Y'. User should be able to keep on entering different Fahrenheit temperature input

Edit the "Program: Temperature" to ask the user to continue by typing 'Y'. User should be able to keep on entering different Fahrenheit temperature input values until they enter a 'N' to quit/exit the program. Turn in only java source file.

import java.util.*; import java.lang.*;

public class Temperature {

public static void main(String[] args) {

// declaring variables double celsius ,farienhiet , Kelvin , delisle , romer;

Scanner keyboard = new Scanner(System.in);

String YourName = "Josh Rickle";

System.out.println("Temperature - "+YourName);

System.out.print("Enter temperature in degrees Fahrenheit: "); farienhiet = keyboard.nextDouble();

// equations

celsius= (farienhiet - 32 ) *(5/9.0);

Kelvin= celsius + 273.15;

delisle= (212 - farienhiet)* (5/6.0);

romer = (farienhiet - 32) *(7/24.0) + 7.5;

// results System.out.println(farienhiet+ " degrees Fahrenheit = "+Math.round(celsius*10000)/10000.0d +" degrees Celsius"); System.out.println(farienhiet+ " degrees Fahrenheit = "+ Math.round(Kelvin*10000)/10000.0d +" kelvins "); System.out.println(farienhiet+ " degrees Fahrenheit = "+ Math.round(delisle*10000)/10000.0d +" degrees Delisle"); System.out.println(farienhiet+ " degrees Fahrenheit = "+ Math.round(romer*10000)/10000.0d +" degrees Romer");

}// main

}// class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the modified version of the Program Temperature that asks the user to continue by typing Y and ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!