PROGRAM HITUNG NILAI AKHIR dengan Java

Sore... ^_^

Kali ini saya mau share lagi tugas UTS Pemrograman Java "PROGRAM HITUNG NILAI AKHIR". Check it out..!!





import java.util.*;
class UTS_no1dan2
{
public static void main(String[] args)

{
String nama,grade;
int n1,n2,n3,n4 ;
double m1,m2,m3,m4 ,mm;

Scanner input = new Scanner(System.in);
System.out.println("PROGRAM HITUNG NILAI AKHIR");

System.out.print("Nama Siswa : " );
nama =input.nextLine();

System.out.print("Masukkan Nilai absensi : ");
n1=input.nextInt();

System.out.print("Masukkan Nilai Tugas : ");
n2=input.nextInt();

System.out.print("Masukkan Nilai UTS : ");
n3=input.nextInt();

System.out.print("Masukkan Nilai UAS : ");
n4=input.nextInt();

m1= 0.1 * n1;
m2= 0.2 * n2;
m3= 0.3 * n3;
m4= 0.4 * n3;
mm= m1+m2+m3+m4;

if(mm >=80)
{
grade= "A" ;
}
else if (mm >=66)
{
grade= "B" ;
}

else if (mm >=55)
{
grade= "C" ;
}
else if (mm >=45)
{
grade= "D" ;
}
else
{
grade="E" ;

}


System.out.print("Siswa yang bernama =" + nama + " ");
System.out.println("Dengan Nilai Persentasi Yang dihasilkan" );
System.out.println("Nilai Absensi * 10% =" + (int)m1);
System.out.println ("Nilai Tugas * 20% =" + (int)m2 );
System.out.println("Nilai UTS * 30% = " + (int)m3 );
System.out.println("Nilai UAS * 50% = " + (int)m4 );

System.out.print("Jadi Siswa yang bernama " + nama + " ");

System.out.println("memperoleh nilai akhir sebesar " + mm);
System.out.println("Grade nilai yang didapat adalah" + " " + grade);

}
}

Untuk nama class dapat diubah sesuai kenginan kalian.. sekian dulu..

0 comments:

Posting Komentar

Related Posts Plugin for WordPress, Blogger...
 
Share for Everyone © 2010 | Designed by Trucks, in collaboration with MW3, Broadway Tickets, and Distubed Tour