/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package nilai;
import java.util.Scanner;
/**
*
* @author ACER
*/
public class Nilai {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner s =new Scanner(System.in);
char c = 0;
int kuis1,kuis2,tugas1,tugas2,a,b;
float nilai_kuis1,nilai_kuis2,nilai_tugas1,nilai_tugas2,nts;
int uts;
float nilai_uts;
System.out.println("masukkan nilai kuis 1 : ");
kuis1 = s.nextInt();
nilai_kuis1=(float) (kuis1*0.1);
System.out.println("masukkan nilai kuis 2 : ");
kuis2 = s.nextInt();
nilai_kuis2=(float)(kuis2*0.1);
System.out.println("masukkan nilai tugas 1 : ");
tugas1 = s.nextInt();
nilai_tugas1=(float)(tugas1*0.1);
System.out.println("masukkan nilai tugas 2 : ");
tugas2 = s.nextInt();
nilai_tugas2=(float)(tugas2*0.1);
System.out.println("masukkan nilai NTS : ");
uts = s.nextInt();
nilai_uts=(float)(uts*0.6);
System.out.println("masukkan pilihan anda :");
a = s.nextInt();
if(a==1){
System.out.println("kuis anda adalah"+nilai_kuis1);
System.out.println("kuis anda adalah"+nilai_kuis2);
System.out.println("kuis anda adalah"+nilai_tugas1);
System.out.println("kuis anda adalah"+nilai_tugas2);
}
if(a==2)
{
nts =nilai_kuis1+nilai_kuis2+nilai_tugas1+nilai_tugas2+nilai_uts;
System.out.println("nilai UTS anda adalah : "+nts);
}
}
}
0 komentar:
Posting Komentar