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") ; } } }

31st Mar 2018, 9:46 AM
Ravinder Singh
Ravinder Singh - avatar
2 Réponses
+ 1
Just add Scanner like shown in the course https://code.sololearn.com/cyuii86e8Pn5/?ref=app
31st Mar 2018, 11:25 AM
Tim Thuma
Tim Thuma - avatar
+ 2
use Scanner object for input
31st Mar 2018, 10:49 AM
G.S.N.V. Suraj
G.S.N.V. Suraj - avatar