import java.io.*;
public class nilai {
public static void main (String []args) throws IOException{
double nilaiakhir;
int uts,uas,tugas,quiz;
String nama;
BufferedReader in = new BufferedReader (new InputStreamReader (System.in));
System.out.println ("Nama anda :");
nama = in.readLine();
System.out.print ("nilai uts : ");
uts = Integer.parseInt(in.readLine());
System.out.print ("nilai uas : ");
uas = Integer.parseInt(in.readLine());
System.out.print ("nilai tugas : ");
tugas = Integer.parseInt(in.readLine());
System.out.print ("nilai quiz : ");
quiz = Integer.parseInt(in.readLine());
nilaiakhir = ((0.3*uts)+(0.4*uas)+(0.2*quiz)+(0.1*tugas));
System.out.println("====================================");
System.out.println();
System.out.println();
System.out.println("saudara " +nama+" "+"nilai akhir anda"+" "+nilaiakhir);
if (nilaiakhir <=100 && nilaiakhir >=80){
System.out.println("Nilai anda 'A'");
}
else if (nilaiakhir <= 79 && nilaiakhir >= 75)
{
System.out.println("nilai anda 'B' ");
}
else if(nilaiakhir <=74 && nilaiakhir >= 65)
{
System.out.println("Nilai anda 'C' ");
}
else if (nilaiakhir <= 64 && nilaiakhir >= 50) {
System.out.println (" Nilai anda 'D' ");
}
else
{
System.out.println(" Nilai anda 'E' ");
}
}
}
Tidak ada komentar:
Posting Komentar