class NilaiArgs{
public static void main(String args[]){
String nama;
double uts,uas;
nama = args[0];
uts = Double.parseDouble(args[1]);
uas = Double.parseDouble(args[2]);
System.out.println("Nama : "+nama);
System.out.println("Nilai UTS : "+uts);
System.out.println("Nilai UAS : "+uas);
double nilaiAkhir = (uts + uas)/2;
System.out.println("Nilai Akhir : "+nilaiAkhir);
}
}
public static void main(String args[]){
String nama;
double uts,uas;
nama = args[0];
uts = Double.parseDouble(args[1]);
uas = Double.parseDouble(args[2]);
System.out.println("Nama : "+nama);
System.out.println("Nilai UTS : "+uts);
System.out.println("Nilai UAS : "+uas);
double nilaiAkhir = (uts + uas)/2;
System.out.println("Nilai Akhir : "+nilaiAkhir);
}
}
Tidak ada komentar