subject

I get an error message on my code below. How can I fix it? import java. util. Scanner;

public class CelsiusToFahrenheit {

public static void main (String [] args) {
Scanner scnr = new Scanner(System. in);

double tempF;
double tempC;

System. out. println("Enter temperature in Celsius: ");
tempC = scnr. nextDouble();

System. out. print("Fahrenheit: ");
System. out. println(tempF);
return;
}
}

CelsiusToFahrenheit. java:16: error: variable tempF might not have been initialized
System. out. println(tempF);
^
1 error

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:30
How many pairs of chromosomes do human body cells contain?
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
Avariable definition defines the name of a variable that will be used in a program, as well as
Answers: 3
question
Computers and Technology, 22.06.2019 22:30
Write a full class definition for a class named player , and containing the following members: a data member name of type string .a data member score of type int .a member function called setname that accepts a parameter and assigns it to name . the function returns no value.a member function called setscore that accepts a parameter and assigns it to score . the function returns no value.a member function called getname that accepts no parameters and returns the value of name .a member function called getscore that accepts no parameters and returns the value of score .this is what i have, aparently this is wrong: class player{private: string name; int score; public: void player: : setname (string n){name =n; }void player: : setscore (int s){score = s; }string player: : getname (){return name; }int player: : getscore (){return score; }};
Answers: 2
question
Computers and Technology, 25.06.2019 08:00
Is a major factor in the widespread use of global information systems
Answers: 1
You know the right answer?
I get an error message on my code below. How can I fix it? import java. util. Scanner;

...
Questions
question
Mathematics, 07.07.2019 13:00
question
Social Studies, 07.07.2019 13:00
question
Computers and Technology, 07.07.2019 13:00
Questions on the website: 13722361