public class kuis {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int i,jum=0;
double rata;
String [] NPM=new String [15];
String [] NAMA=new String [10];
String [] JURUSAN=new String [10];
String [] MK=new String [10];
int [] tgs=new int [10];
int [] uas=new int [10];
int [] uts= new int [10];
garis();
System.out.println(" MENU PILIHAN ");
garis();
System.out.println("1. MENGHITUNG JUMLAH MAHASISWA");
System.out.println("");
System.out.println("2. EXIT");
System.out.println("");
garis();
System.out.println("Anda Pilih Nomor : ");int pil=input.nextInt();
switch(pil){
case 1:{
garis();
System.out.println(" MENGHITUNG JUMLAH MAHASISWA");
garis();
System.out.print(" MASUKAN JUMLAH MAHASISWA : ");
int n=input.nextInt();
for ( i=0;i<=n;i++){
System.out.print("NPM :");NPM[i]=input.next();
System.out.print("NAMA :");NAMA[i]=input.next();
System.out.print("JURUSAN :");JURUSAN[i]=input.next();
System.out.print("MK :");MK[i]=input.next();
System.out.print("tgs :");tgs[i]=input.nextInt();
System.out.print("uas :");uas[i]=input.nextInt();
System.out.print("uts :");uts[i]=input.nextInt();
jum=(tgs[i]+uas[i]+uts[i]);
rata=jum/3;System.out.println("NILAI RATA-RATA :"+rata);
System.out.println("");
}
break;
}
default:System.exit(0);
}
}
static void garis(){
System.out.println("===========================");
}
}
0 komentar:
Posting Komentar