0% found this document useful (0 votes)
234 views1 page

Gred Calculation in Java Program

The document defines a Java class that takes a student's mark as a double variable, then uses if/else statements to assign a letter grade based on the mark ranges, with thresholds from 90 to 0. It prints out the student's mark and assigned grade.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
234 views1 page

Gred Calculation in Java Program

The document defines a Java class that takes a student's mark as a double variable, then uses if/else statements to assign a letter grade based on the mark ranges, with thresholds from 90 to 0. It prints out the student's mark and assigned grade.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Public class Contoh25 {

public static void main (String[] args) {


double markah=73;
String Gred;
if (markah >= 90) {
Gred = A +;
} else if (markah >= 80) {
Gred = A;
} else if (markah >= 75) {
Gred = A-;
} else if (markah >= 70) {
Gred = B+;
} else if (markah >= 65) {
Gred = B
} else if (markah >= 60) {
Gred = C+;
} else if (markah >= 50) {
Gred = C;
} else if (markah >= 45) {
Gred = D;
} else if (markah >= 40) {
Gred = E;
} else if (markah >= 0) {
Gred = G; }
[Link] (Markah = +markah+ dan Gred ialah +Gred);
}
}

You might also like