Simpan file dengan nama lat......
perhitungan nilai matakuliah menggunakan java....
tugas 10%
quiz 20%
uts 30%
uas 40%
import java.util.Scanner;
import javax.swing.*;
public class lat {
public static void main (String[] args)
{
Scanner in = new Scanner (System.in);
String nama, nim, kelas, matakuliah;
int tugas, quiz, uts, uas;
System.out.print("Nama : ");
nama = in.nextLine();
System.out.print("Nim : ");
nim = in.nextLine();
System.out.print("Kelas : ");
kelas = in.nextLine();
System.out.print("Matakuliah : ");
matakuliah = in.nextLine();
System.out.print("Nilai Tugas : ");
tugas = in.nextInt();
System.out.print("Nilai Quiz : ");
quiz = in.nextInt();
System.out.print("Nilai UTS : ");
uts = in.nextInt();
System.out.print("Nilai UAS : ");
uas = in.nextInt();
System.out.println("----------------------------------------");
System.out.println("Nama : "+nama);
System.out.println("NIM : "+nim);
System.out.println("Kelas : "+kelas);
System.out.println("Matakuliah : "+matakuliah);
double nilai;
nilai = (0.1*tugas)+(0.2*quiz)+(0.3*uts)+(0.4*uas);
if((nilai<=100)&(nilai>=80))
System.out.println("Hasil akhir : "+nilai+" Grade : A");
else
if((nilai<=79)&(nilai>=67))
System.out.println("Hasil akhir : "+nilai+" Grade : B");
else
if((nilai<=66)&(nilai>=50))
System.out.println("Hasil akhir : "+nilai+" Grade : C");
else
System.out.println("Hasil akhir : "+nilai+" Grade : D");
System.out.println("-----------------------------------------");
}
}