+ 1
Write a program that checks if the water is boiling. Take the integer temperature in Celsius as input and output "Boiling" if t
12 Respuestas
+ 3
NEZ How long did that take you?😂
+ 3
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 >=99) {
System.out.println("Boiling");
} else if (temp >=250) {
System.out.println("Boiling");
} else {
System.out.println("Not Boiling");
}
}
}
+ 1
Siddhartha Kushwaha
You have a few problems. You forgot a colon and your spacing is bad.
Take a look at this.
https://code.sololearn.com/cVpQgdU2N41z/?ref=app
+ 1
in = int(input())
if in >= 100:
print("boiling")
else:
print("not boiling")
+ 1
i want the perfect program in java
+ 1
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
//your code goes here
Scanner sc = new Scanner(System.in);
int temperatureCelsius = sc.nextInt();
if (temperatureCelsius >= 100) {
System.out.println("Boiling");
} else {
System.out.println("Not boiling");
}
}
}
0
Well, that should be relatively easy...
In pseudo code
1| varialde temperature = input()
2| if temperature is greater than pr equal to 100
3| print "Boiling"
0
Have you tried writing it at all?
I'm not good with python...
0
Yes tried hundred of times.
0
Share your attempts, maybe I or somepne else could spot the error?
0
temp = int(input())
temp=100
if temp==100:
print("boiling")
else:
if temp>=100
print("nothing")
0
temp=int(input())
if(temp>=100):
print("boiling")