Computer Science, asked by agarwalaadya19, 1 month ago

Raashi's parent put a condition that if she gets A grade then she can go out with her friends. if she gets B grade then she will have to take extra tuitions and if she gets C grade then she will not watch tv anymore. Write a java program to display correct message based on her grades.

Answers

Answered by viperracingyt104
0

java.util.Scanner;

public class grademarks {

public static void main (String args[]) {

System.out.println ("Enter grade from A to C");

Scanner g = new Scanner(System.in);

String G = g.nextLine();

if (G ="A") {

System.out.println ("You can go out with your friends");

}

else if (G="B") {

System.out.println ("You have to take extra tutions");

}

else if (G="C") {

System.out.println ("You will not watch tv anymore");

}

else {

System.out.println ("Error")

   }

 }

}

Similar questions