Halaman

Diberdayakan oleh Blogger.
RSS

TUGAS PBO IBU SURYANINGRUM


PROGRAM JAVA PERHITUNGAN NILAI



LISTING PROGRAM

import java.io.*;
public class Hitung {
public static void main(String[] args) throws Exception
{
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
String nim[] = new String[3];
String nama[] = new String[3];
String mk[] = new String[3];
double nia[] = new double[3];
String nih[] = new String[3];
int pil = 0;
double tugas,uts,uas;
tugas = 0;
uts = 0;
uas = 0;
do
{
System.out.println("============================================");
System.out.println(" Program penilaian mahasiswa\t");
System.out.println("============================================");
System.out.println(" 1. Input data nilai mahasiswa" );
System.out.println(" 2. Data nilai akhir dan huruf mahasiswa" );
System.out.println(" 3. Keluar" );
System.out.print(" masukkan no.pilihan anda(1-3): ");
pil = Integer.parseInt(br.readLine());
switch (pil){
case 1:
System.out.println();
System.out.println("============================================");
System.out.println(" Input data nilai mahasiswa\t");
System.out.println("============================================");
for(int i=0; i<3; i++)
{
System.out.println(i+1+".");
System.out.print("Nama Mahasiswa : ");
nama[i] = br.readLine();
System.out.print("Nama Mata Kuliah : ");
mk[i] = br.readLine();
System.out.print("Nilai Tugas : ");
tugas = Double.parseDouble(br.readLine());
System.out.print("Nilai UTS : ");
uts = Double.parseDouble(br.readLine());
System.out.print("Nilai UAS : ");
uas = Double.parseDouble(br.readLine());
nia[i] = 0.1*tugas + 0.6*uts + 0.3*uas;
if (nia[i] >=0 && nia[i] <45)
{
nih[i]="E";
}
else if(nia[i]>44 && nia[i]<55)
{
nih[i]="D";
}
else if(nia[i]>=55 && nia[i]<60)
{
nih[i]="C";
}
else if(nia[i]>=60 && nia[i]<65)
{
nih[i]="C+";
}
else if(nia[i]>=65 && nia[i]<75)
{
nih[i]="B";
}
else if(nia[i]>=75 && nia[i]<80)
{
nih[i]="B+";
}
else if(nia[i]>=80 && nia[i]<90)
{
nih[i]="A";
}
else if(nia[i]>=90 && nia[i]<=100)
{
nih[i]="A+";
}
}
break;
case 2:
System.out.println();
System.out.println("============================================");
System.out.println(" Hasil Perhitungan Nilai\t");
System.out.println("============================================");
for(int j=0; j<3; j++)
{
System.out.println(j+1+".");
System.out.println("Nama Mahasiswa : "+ nama[j]);
System.out.println("Nama Mata Kuliah : "+ mk[j]);
System.out.println("Nilai Akhir : "+ nia[j]);
System.out.println("Nilai Huruf : "+ nih[j]);
System.out.println();
}
break;
default: break;
}
}
while(pil<3);
}
}

OUTPUT PROGRAM


  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS