What's Wrong With My Code?? | SoloLearn: Learn to code for FREE!


What's Wrong With My Code??

else without if https://code.sololearn.com/cyUBU3Ub132W/?ref=app

11/10/2019 3:30:41 PM


2 Answers

New Answer


Given if (choice.equalsIgnoreCase(s1)) System.out.print(" **Grades of Students**\nPlease Enter the Name of Your Course(ex: MATH-110): "); String gradeCourse = input.next(); System.out.print("Please Enter the No. of Student in "+gradeCourse+": "); only first statement is within if, rest of the statement are outside hence else is without if ! use curly brackets in if if (...) { } else if (...) { }