- 1
Can someone pls help me, I'm really confused
Write a program that checks 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. Sample Input 105 Sample Output Boiling My answer temp = int(input()) if temp >= 100: print (temp("Boiling")) else: print ("The water is not boiling") There is something wrong about my answer
13 Answers
+ 5
Firstly, `temp` is not the name of a function. Why are you calling it on line 4? The `temp` on that line is just wrong and useless.
Secondly, you need indentation in if statements. See here how to use if-statements again (especially read the yellow box on page 1)
https://www.sololearn.com/learning/2277/
+ 1
Indentation issue.
temp = int(input())
if temp >= 100:
print('Boiling');
else:
print('Not boiling');
+ 1
temp = int(input())
If temp >=100:
Print ("Boiling")
Put some space before print("boiling")
Otherwise indentation issue
0
Write a program that checks if the water is boiling
Take the integer temperature in Celsius as input and output "Boiling" if temperature is above or equal to 100
Sample Input
105
Sample output
Boiling
My answer:
temp = int(input())
if temp>=100:
print("Boiling")
else:
print(" ")
0
Write a program that checks 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.
Sample Input
105
Sample Output
Boiling
temp = int(input())
if temp >= 100:
print('Boiling');
0
temp = int(input())
if temp>=100:
print("Boiling")
0
This is my equation yet im still wrong
Temp = int(input())
if temp >= (100 * 9/5):
print(“boiling”)
Im new to this and im pretty sure im getting tunnel vision can anyone help i dont need the answer just direction
0
0
Answer
0
But app doesn't accept the right code
0
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
____________________________________________________________________________________________________________________
THIS CODE PASSED ALL THE TEST CASES !!!!!!!!
import java.util.Scanner;
public class BoilingWaterSensor {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int temperature = scanner.nextInt();
scanner.close();
String result = checkBoiling(temperature);
System.out.println(result);
}
private static String checkBoiling(int temperature) {
if (temperature >= 100) {
return "Boiling";
} else {
return "Not boiling";
}
}
}
- 1
Thank youuu🙂
- 2
temp = int(input())
if temp >= 100:
print("Boiling")
this is the answer. B should be capital in Boiling