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"); } } }

30th Nov 2022, 3:25 PM
David Bharati
10 odpowiedzi
+ 1
Can you add task description or number?
30th Nov 2022, 3:55 PM
Jayakrishna 🇮🇳
+ 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
30th Nov 2022, 6:29 PM
David Bharati
+ 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..
30th Nov 2022, 7:32 PM
Jayakrishna 🇮🇳
+ 1
I tested your code with the change "Not boiling" . And it passing all cases.
1st Dec 2022, 2:30 PM
Jayakrishna 🇮🇳
+ 1
Boiling(wrong) Boiling! (Right)
2nd Dec 2022, 12:09 PM
Prashant Rai
0
Code running fine. Check spelling for output statements according to description.. may be "Not boiling"
30th Nov 2022, 3:36 PM
Jayakrishna 🇮🇳
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
30th Nov 2022, 3:44 PM
David Bharati
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
1st Dec 2022, 6:47 AM
David Bharati
0
did you figure it out ?
1st Dec 2022, 5:39 PM
ReinedDesires
ReinedDesires - avatar
0
Check parantheses. }
2nd Dec 2022, 12:22 PM
THIRUMALA RAJA VENKATA SAI KUMAR
THIRUMALA RAJA VENKATA SAI KUMAR - avatar