import java.util.Scanner;
public class ExamPractice {
public static void main(String[] args) {
do{
Scanner keyboard=new Scanner (System.in);
System.out.println("Please enter a degrees farenheight");
double fahr=keyboard.nextDouble();
double celc= 5/9.0 *(fahr-32);
System.out.println("It is "+celc+"degrees celcius");
System.out.println("Would you like to try again?");
String answer=keyboard.next();
}while(answer.equalsIgnoreCase("yes"));
}
}
Can someone explain to me what is wrong with this code. The answer in the while condition is underlined error in my compiler. I feel like I'm making a dumb mistake, but I can't put my finger on it.
Thanks

New Topic/Question
Reply



MultiQuote







|