Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

// i need help with the program below. i have to convert celsius to fahrenheit.

ID: 3836086 • Letter: #

Question

// i need help with the program below. i have to convert celsius to fahrenheit. the it has to be written in java programmingm and the software that im using is dr java.

import java.util.Scanner;
public class TempConvert {
// Your code for celsiusToFahrenheit here

public static void main(String [] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter current temperature in Celsius: ");
double celsius = in.nextDouble();
System.out.println(celsius + " Celsius is " + celsiusToFahrenheit(celsius) + " in Fahrenheit");
}
}

Explanation / Answer

import java.util.Scanner;
public class TempConvert {
// Your code for celsiusToFahrenheit here
public static double celsiusToFahrenheit(double celsius)
{
   return (celsius * 9.0/5) + 32;
}

public static void main(String [] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter current temperature in Celsius: ");
double celsius = in.nextDouble();
System.out.println(celsius + " Celsius is " + celsiusToFahrenheit(celsius) + " in Fahrenheit");
}
}