Script Membuat Tes Fungsi di Neatbents
Script Membuat Tes Fungsi di Neatbents
package tesfungsi;
import java.io.*;
public class Tesfungsi {
public static void main(String[] args) throws IOException {
String str, nama, npm;
double mid, semester;
BufferedReader Get= new BufferedReader (new InputStreamReader(System.in));
Tesfungsi akhir=new Tesfungsi();
Tesfungsi huruf=new Tesfungsi();
System.out.println("Menghitung Kelulusan Mahasiswa");
System.out.println("--------------------------------");
System.out.print("Nama : ");nama=Get.readLine();
System.out.print("NPM : ");npm=Get.readLine();
System.out.print("Nilai Mid : "); str=Get.readLine();
mid=Double.parseDouble(str);
System.out.print("Nilai Semester : ");nama=Get.readLine();
semester=Double.parseDouble(str);
System.out.println("Nilai Akhir : "+akhir.na(mid,semester));
double nakhir=akhir.na(mid, semester);
System.out.println("Nilai Huruf : "+huruf.nhuruf(nakhir));
}
double na(double mid, double semester){
double nakhir;
nakhir=0.4*mid+0.6*semester;
return(nakhir);
}
String nhuruf(double nakhir) {
String hurufn;
if (nakhir>=80){
hurufn="A";
}
else if (nakhir>=70){
hurufn="B";
}
else if (nakhir>=60){
hurufn="C";
}
else if (nakhir>=50){
hurufn="D";
}
else {
hurufn="E";
}
return(hurufn);
}
}
import java.io.*;
public class Tesfungsi {
public static void main(String[] args) throws IOException {
String str, nama, npm;
double mid, semester;
BufferedReader Get= new BufferedReader (new InputStreamReader(System.in));
Tesfungsi akhir=new Tesfungsi();
Tesfungsi huruf=new Tesfungsi();
System.out.println("Menghitung Kelulusan Mahasiswa");
System.out.println("--------------------------------");
System.out.print("Nama : ");nama=Get.readLine();
System.out.print("NPM : ");npm=Get.readLine();
System.out.print("Nilai Mid : "); str=Get.readLine();
mid=Double.parseDouble(str);
System.out.print("Nilai Semester : ");nama=Get.readLine();
semester=Double.parseDouble(str);
System.out.println("Nilai Akhir : "+akhir.na(mid,semester));
double nakhir=akhir.na(mid, semester);
System.out.println("Nilai Huruf : "+huruf.nhuruf(nakhir));
}
double na(double mid, double semester){
double nakhir;
nakhir=0.4*mid+0.6*semester;
return(nakhir);
}
String nhuruf(double nakhir) {
String hurufn;
if (nakhir>=80){
hurufn="A";
}
else if (nakhir>=70){
hurufn="B";
}
else if (nakhir>=60){
hurufn="C";
}
else if (nakhir>=50){
hurufn="D";
}
else {
hurufn="E";
}
return(hurufn);
}
}
0 Response to "Script Membuat Tes Fungsi di Neatbents"
Post a Comment
Silahkan Komentar ....