I get an error message on my code below. How can I fix it?
import java. util. Scanner;
...
Computers and Technology, 22.06.2021 01:40 animelover730
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
Answers: 2
Computers and Technology, 21.06.2019 17:30
How many pairs of chromosomes do human body cells contain?
Answers: 2
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
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
Computers and Technology, 25.06.2019 08:00
Is a major factor in the widespread use of global information systems
Answers: 1
Biology, 07.07.2019 13:00
History, 07.07.2019 13:00
Mathematics, 07.07.2019 13:00
Biology, 07.07.2019 13:00
Social Studies, 07.07.2019 13:00
English, 07.07.2019 13:00
Mathematics, 07.07.2019 13:00
Mathematics, 07.07.2019 13:00
Business, 07.07.2019 13:00
English, 07.07.2019 13:00
Computers and Technology, 07.07.2019 13:00