0
How can I add user input method for marks in this code?
class GradesCalculator { public static void main (String [] args) { int marks = 95 ; if ( marks <= 69) { if ( marks <=49 ) { System.out.println (" Fail") ; } else { System.out.println (" Grade B") ; } } if (marks >= 70) { System.out.println ("Grade A") ; } } }
2 Answers
+ 1
Just add Scanner like shown in the course
https://code.sololearn.com/cyuii86e8Pn5/?ref=app
+ 2
use Scanner object for input