Coding
import java.io.*;
public class yuni
{public static void main (String[] args)throws Exception
{DataInputStream karakter = new DataInputStream(System.in);
System.out.print("masukan nilai tugas : ");
String nil1 = karakter.readLine();
double xnil1 = Double.valueOf(nil1).doubleValue();
System.out.print("masukan nilai uts : ");
String nil2 = karakter.readLine();
double xnil2 = Double.valueOf(nil2).doubleValue();
System.out.print("masukan nilai uas : ");
String nil3 = karakter.readLine();
double xnil3 = Double.valueOf(nil3).doubleValue();
double tugas = xnil1*0.2 ;
double uts = xnil2*0.3 ;
double uas = xnil3*0.5 ;
double jumlah = tugas + uts + uas ;
System.out.println("rata-rata nilai adalah :"+jumlah);
}
}
0 komentar:
Posting Komentar