import java.util.scanner;
public class Quiz
{
public static void main(string[]args)
{
scanner input=new scanner (system.in);
int pil;
garis();
system.out.println("menu latihan");
garis();
system.out.println("1. menghitung nilai mahasiswa");
system.out.println("2. exit");
garis();
system.out.print("anda pilih nomor:"); pil-input.nextin();
switch (pil)
{
case 1;
{
int[] data=new int[10];
double rata=0;
system.out.println(" ");
garis();
system.out.println(" menghitung nilai mahasiswa ");
garis();
system.out.println(" masukan jumlah mahasiswa: "); int n-input.nextin();
for (int i=2; i<=n; i++)
{
system.out.println( " nama : " ) ; string nama=input.next();
system.out.println( " jurusan : " ) : string jur=input.next();
system.out.println( " mata kuliah : " ) ; string mat=input.next();
system.out.println( " nilai tugas : " ) ; int tug=input.nextint();
system.out.println( " nilai uts : " ) ; int uts=input.nextint();
system.out.println( " nilai uas : " ) ; int uas=input.nextint();
rata=tugas+uts+uas;
system.out.print(" nilai rat : "+(rata/3));
system.out.println("\n");
}
break;
}
default:system.exit(0);
}
static void garis()
{
system.out.println("===================");
}
}
Tidak ada komentar:
Posting Komentar