0% found this document useful (0 votes)
41 views2 pages

Nama: Ahmad Kardawi Stambuk: 1820221067 Import Public Class Public Static Void Int, ,,, New New If Else If Else If Else If Else

The document contains a Java program that takes a student's name, student ID number, and scores on assignments, midterms, and finals as input. It then calculates the student's average score, and assigns a letter grade based on the average. The program outputs the student's calculated average score and assigned letter grade.

Uploaded by

Ahmad Kardawi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views2 pages

Nama: Ahmad Kardawi Stambuk: 1820221067 Import Public Class Public Static Void Int, ,,, New New If Else If Else If Else If Else

The document contains a Java program that takes a student's name, student ID number, and scores on assignments, midterms, and finals as input. It then calculates the student's average score, and assigns a letter grade based on the average. The program outputs the student's calculated average score and assigned letter grade.

Uploaded by

Ahmad Kardawi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Nama : Ahmad Kardawi

Stambuk : 1820221067

import java.util.Scanner;
public class ahmadkardawi3 {
public static void main (String [] args){
int st, nt, nmid, nf, na;
String nama ;
String nh = new String();
Scanner scan = new Scanner(System.in);

System.out.printf("Masukkan Nama Kamu : ");


nama=scan.nextLine();
System.out.printf("Stambuk : ");
st = scan.nextInt();
System.out.printf("Nilai Tugas : ");
nt = scan.nextInt();
System.out.printf("Nilai Mid : ");
nmid = scan.nextInt();
System.out.printf("Nilai Final : ");
nf = scan.nextInt();

na = nt + nmid + nf/3;

if (na>85){
nh = "A";
}
else if (na>70){
nh = "B";
}
else if (na>60){
nh = "C";
}
else if (na>50){
nh = "D";
}
else {
nh = "E";
}

System.out.print("Nilai Akhirnya Adalah : "+na+" dan Nilai


Hurufnya Adalah : "+nh);

}
}

You might also like