Q1: Can you read this question carefully rebug and type the answers Debug Problem 1: As an intern for The Weather Channel, you have been instructed to debug a java program that converts Celsius to Fahrenheit. If the formula runs correctly, then 12 degrees in Celsius should give 54 degrees in Fahrenheit . Here is the formula given and it might not be correctly stated in terms of () needed and the order of operations. Google a reputable site if needed.: °F = °C x 9/5 + 32 Remember that there may be more than one problem to fix. It could be that variables have an incorrect data type. It could be that the formula is not coded correctly. Also, some import statements could be missing. Copy and paste the code below in JGrasp and debug the code. Here is the code to debug: // Convert Celsius to Fahrenheit class CelsiusToFahr { public static void main (String args[]) { Scanner keyboard = new Scanner(System.in); int celsius = 0; int fahr = 0; System.out.println("Input the degrees in Celsius"); celsius = keyboard.nextInt(); fahr = 9/5 * celsius + 32.0; System.out.println(celsius + "degrees in celsius gives " + fahr + " degrees in fahrenheit "); } }
Q1: Can you read this question carefully rebug and type the answers
Debug Problem 1:
As an intern for The Weather Channel, you have been instructed to debug a java program that
converts Celsius to Fahrenheit. If the formula runs correctly, then 12 degrees in Celsius should
give 54 degrees in Fahrenheit .
Here is the formula given and it might not be correctly stated in terms of () needed and the
order of operations. Google a reputable site if needed.:
°F = °C x 9/5 + 32
Remember that there may be more than one problem to fix. It could be that variables have an
incorrect data type. It could be that the formula is not coded correctly. Also, some import
statements could be missing.
Copy and paste the code below in JGrasp and debug the code.
Here is the code to debug:
// Convert Celsius to Fahrenheit
class CelsiusToFahr
{
public static void main (String args[])
{
Scanner keyboard = new Scanner(System.in);
int celsius = 0;
int fahr = 0;
System.out.println("Input the degrees in Celsius");
celsius = keyboard.nextInt();
fahr = 9/5 * celsius + 32.0;
System.out.println(celsius + "degrees in celsius gives " + fahr + " degrees in fahrenheit ");
}
}

Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images









