Can someone help me find the problem in this code? Thank you! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone help me find the problem in this code? Thank you!

https://code.sololearn.com/c08pQh16RIp3/?ref=app

26th Oct 2017, 12:26 AM
Rachel L.
Rachel L. - avatar
3 Answers
+ 3
public class Program { public static void main(String[] args) { int a=(100); if(a<900){System.out.println("You're under 900");} else if(a<800){System.out.println("Youre under 800");} else if(a<101){System.out.println("just barely under 101");} else if(a>50){System.out.println("over 50");} } } This works. You didn't declare a variable so I added a. You referenced int within your if statements and it should have been your variable. You used Program in place of System and Println instead of println for your output lines. You're semicolons need to be before the } instead of after. Your not going to be happy with your output.
26th Oct 2017, 12:36 AM
John Wells
John Wells - avatar
26th Oct 2017, 12:40 AM
Morpheus
Morpheus - avatar
0
as John said, and here's the code
26th Oct 2017, 12:40 AM
Morpheus
Morpheus - avatar