0
I cant understand what the problem here is. Can anyone help me out? the system in sololearn called it an error in test case 1
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int temp=sc.nextInt(); if (temp>=100){ System.out.println("Boiling"); }else{ System.out.println("Not Boiling"); } } }
10 Respuestas
+ 1
Can you add task description or number?
+ 1
Yeah it's this task of Conditional Satements in java.
Boiling Water
You are making a program for a water sensor that should check if the water is boiling.
Take the integer temperature in Celsius as input and output "Boiling" if the temperature is above or equal to 100.
Output "Not boiling" if it's not.
Sample Input
105
Sample Output
Boiling
+ 1
I think it should work after the spell correction. Again check is there any extra character or space in output.
In java course, there is no task that. It may be from new "Intro to Java course" which is not available to me.
Post your update code , and let me see if any mistake..
+ 1
I tested your code with the change "Not boiling" . And it passing all cases.
+ 1
Boiling(wrong)
Boiling! (Right)
0
Code running fine.
Check spelling for output statements according to description.. may be "Not boiling"
0
I guess that's fine too. The test cases 2 and 3 are correct though. In test case 1 too, the expected result is Not boiling and that's what i got but it's still showing incorrect
0
yeah it is from the Introduction to Java course and i cant figure out my error. I checked it and even tallied that with the solution given
0
did you figure it out ?
0
Check parantheses. }