Publicité
Write a program that finds the temperature- as an integer - that is th.docx
Write a program that finds the temperature- as an integer - that is th.docx
Prochain SlideShare
Write a SIMPLE java program to print out the numbers from 100 to 1- wi.docxWrite a SIMPLE java program to print out the numbers from 100 to 1- wi.docx
Chargement dans ... 3
1 sur 2
Publicité

Contenu connexe

Plus de drosa1(20)

Publicité

Write a program that finds the temperature- as an integer - that is th.docx

  1. Write a program that finds the temperature, as an integer , that is the same in both Celsius and Fahrenheit. The formula to convert from Celsius to Fahrenheit is: Fahrenheit = 32 + (nine fifths) times Celsius. Solution Program: Program: import java.util.Scanner; public class JavaApplication { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double celsius, fahrenheit; System.out.print("Enter a temperature in Celsius: "); celsius = sc.nextDouble(); fahrenheit = 32 + (celsius * 9 / 5); System.out.println(celsius +" ºC = " + fahrenheit + " ºF"); } }
Publicité