TUGAS MANDIRI 2 LATIHAN JCREATOR
“MEMBUAT DAFTAR NILAI UJIAN MAHASISWA”
Codding :
/**
* @(#)tugas.java
*
*
* @author
* @version 1.00 2015/2/23
*/
import java.util.Scanner;
public class tugas {
public static void main (String [] args) {
Scanner input=new Scanner (System.in);
//deklarasi variabel
String a,b,c;
double tugas,absen,uts,uas,akhir;
System.out.println ("");
System.out.println ("DAFTAR NILAI UJIAN");
System.out.println ("------------------");
System.out.println ("");
System.out.print("NPM : ");
a = input.nextLine();
System.out.print("Nama : ");
b = input.nextLine();
System.out.print("Jurusan : ");
c = input.nextLine();
System.out.print("Nilai Tugas : ");
tugas = input.nextInt();
System.out.print("Nilai Absen : ");
absen = input.nextInt();
System.out.print("Nilai UTS : ");
uts = input.nextInt();
System.out.print("Nilai UAS : ");
uas = input.nextInt();
System.out.println ("----------------------------------");
akhir= (0.10*tugas)+(0.10*absen)+(0.30*uts)+(0.50*uas);
System.out.print ("Nilai Akhir Anda : " + (akhir));
}
}
* @(#)tugas.java
*
*
* @author
* @version 1.00 2015/2/23
*/
import java.util.Scanner;
public class tugas {
public static void main (String [] args) {
Scanner input=new Scanner (System.in);
//deklarasi variabel
String a,b,c;
double tugas,absen,uts,uas,akhir;
System.out.println ("");
System.out.println ("DAFTAR NILAI UJIAN");
System.out.println ("------------------");
System.out.println ("");
System.out.print("NPM : ");
a = input.nextLine();
System.out.print("Nama : ");
b = input.nextLine();
System.out.print("Jurusan : ");
c = input.nextLine();
System.out.print("Nilai Tugas : ");
tugas = input.nextInt();
System.out.print("Nilai Absen : ");
absen = input.nextInt();
System.out.print("Nilai UTS : ");
uts = input.nextInt();
System.out.print("Nilai UAS : ");
uas = input.nextInt();
System.out.println ("----------------------------------");
akhir= (0.10*tugas)+(0.10*absen)+(0.30*uts)+(0.50*uas);
System.out.print ("Nilai Akhir Anda : " + (akhir));
}
}
Output :
Selamat mencoba
Tidak ada komentar:
Posting Komentar