Quis
import java.util.Scanner;
public class Main {
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 [30];
String [] Jur=new String [30];
String [] mk=new String [30];
int[] tgs=new int[10];
int[] uts=new int[10];
int[] uas=new int[10];
garis();
System.out.println(" MENU PILIHAN");
garis();
System.out.println("1. MENGHITUNG NILAI MAHASISWA (ARRAY)");
System.out.println("2. EXIT");
System.out.println("");
garis();
System.out.print("Anda Pilih Nomor =");int pil=input.nextInt();
switch(pil){
case 1 :{
garis();
System.out.println(" MENGHITUNG NILAI MAHASISWA");
garis();
System.out.print("MASUKAN JUMLAH MAHASISWA :");int j=input.nextInt();
for (i=0;i<j;i++){
System.out.print("NPM :");NPM[i]=input.next();
System.out.print("NAMA :");Nama[i]=input.next();
System.out.print("JURUSAN :");Jur[i]=input.next();
System.out.print("MATA KULIAH :");mk[i]=input.next();
System.out.print("NILAI TUGAS :");tgs[i]=input.nextInt();
System.out.print("NILAI UTS :");uts[i]=input.nextInt();
System.out.print("NILAI UAS :");uas[i]=input.nextInt();
jum=(jum+tgs[i]+uts[i]+uas[i]);
rata=jum/3;
System.out.println("NILAI RATA-RATA :"+rata);
System.out.println("");
}
System.out.println(" NPM Nama Jurusan MataKuliah Nilai Tugas Nilai UTS Nilai UAS");
garis();
System.out.println( NPM[i]+" "+Nama[i]+" "+Jur[i]+" "+mk[i]+" "+tgs[i]+" "+uts[i]+" "+uas[i]);
break;
}
default:System.exit(0);
}
}
static void garis(){
System.out.println("==============================================");
}
}
Outputnya
Tidak ada komentar:
Posting Komentar