Due to poor results of examination, your teacher decides to increase each student’s grade by 5 points. Input the grade and the new grade, If the original grade exceeds 90, then the grade remains as such.
Sun Dec 08 2024 10:13:16 GMT+0000 (Coordinated Universal Time)
Saved by
@John_Almer
package gradeincrease;
import java.util.Scanner;
public class GradeIncrease {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter the original grade: ");
double originalGrade = input.nextDouble();
double newGrade = originalGrade;
if (originalGrade < 90) {
newGrade += 5;
}
System.out.println("The new grade is: " + newGrade);
}
}
content_copyCOPY
Comments