Source Code :
import java.util.Scanner;
public class Nilai {
public static void main(String[]args){
Scanner input = new Scanner(System.in);
double nAkhir;
char nilai;
System.out.print("Masukkan nama anda : ");
String nama = input.nextLine();
System.out.print("Nilai UTS : ");
double uts = input.nextDouble();
System.out.print("Nilai UAS : ");
double uas = input.nextDouble();
System.out.print("Nilai Quiz : ");
double quiz = input.nextDouble();
System.out.print("Nilai Tugas : ");
double tugas = input.nextDouble();
nAkhir = ((0.3*uts)+ (0.4*uas)+ (0.2*quiz)+(0.1*tugas));
if( nAkhir>=80 && nAkhir<=100 ){
nilai = 'A';
}else if(nAkhir>=65 && nAkhir<80){
nilai = 'B';
}else if(nAkhir>=55 && nAkhir<65){
nilai = 'C';
}else{}{
nilai = 'D';
}
System.out.println("Saudara "+nama+" nilai akhir anda "+nAkhir+", anda dapat "+nilai);
}
}
Outputnya :
Silahkan Copas Gannnn,,,,
Tapi Tolong Jangan Lupa Komentarnya yy gann,,,
0 comments:
:)) :)] ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} ~x( :-t b-( :-L x( =))
Post a Comment