/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author PM1-06
*/
import java.util.Scanner;
public class Menu {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
garis();
System.out.println(" MENU PILIHAN ");
garis();
System.out.println("1. MENGHITUNG NILAI MAHASISWA (ARRAY)");
System.out.println("");
System.out.println("2. EXIT");
garis();
System.out.println("");
System.out.print("Anda pilih nomer :");
int pilih=input.nextInt();
switch(pilih){
case 1:{
garis();
System.out.println(" MENGHITUNG NILAI MAHASISWA");
garis();
System.out.print("Masukan jumlah mahasiswa :"); int n=input.nextInt();
int[] data=new int[10];
for (int i=1;i<=n;i++){
System.out.println("data ke"+i +":");
System.out.print("NPM :"); String npm=input.next();
System.out.print("NAMA :"); String nama=input.next();
System.out.print("JURUSAN :"); String jur=input.next();
System.out.print("MATA KULIAH :"); String mk=input.next();
System.out.print("NILAI TUGAS :"); int n_tgs=input.nextInt();
System.out.print("NILAI UTS :"); int n_uts=input.nextInt();
System.out.print("NILAI UAS :"); int n_uas=input.nextInt();
int n_rata=(n_tgs+n_uts+n_uas)/3;
System.out.print("NILAI Rata-rata :"+n_rata);
}
break;
}
default:System.exit(0);
}}
static void garis(){
System.out.println("====================================");
}
}
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author PM1-06
*/
import java.util.Scanner;
public class Menu {
public static void main(String[] args){
Scanner input=new Scanner(System.in);
garis();
System.out.println(" MENU PILIHAN ");
garis();
System.out.println("1. MENGHITUNG NILAI MAHASISWA (ARRAY)");
System.out.println("");
System.out.println("2. EXIT");
garis();
System.out.println("");
System.out.print("Anda pilih nomer :");
int pilih=input.nextInt();
switch(pilih){
case 1:{
garis();
System.out.println(" MENGHITUNG NILAI MAHASISWA");
garis();
System.out.print("Masukan jumlah mahasiswa :"); int n=input.nextInt();
int[] data=new int[10];
for (int i=1;i<=n;i++){
System.out.println("data ke"+i +":");
System.out.print("NPM :"); String npm=input.next();
System.out.print("NAMA :"); String nama=input.next();
System.out.print("JURUSAN :"); String jur=input.next();
System.out.print("MATA KULIAH :"); String mk=input.next();
System.out.print("NILAI TUGAS :"); int n_tgs=input.nextInt();
System.out.print("NILAI UTS :"); int n_uts=input.nextInt();
System.out.print("NILAI UAS :"); int n_uas=input.nextInt();
int n_rata=(n_tgs+n_uts+n_uas)/3;
System.out.print("NILAI Rata-rata :"+n_rata);
}
break;
}
default:System.exit(0);
}}
static void garis(){
System.out.println("====================================");
}
}
0 komentar:
Posting Komentar
: Ayoo sharingg.. :D