Average in java

the first i want to story about my collage my lacture give to me examination how to make a program with java then i tell to him i can make that but i need just hour to make that program just simple direct with the program
Import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Rata2 {

public static void main(String[] args) throws IOException {
 double h, k, t;
 float s, q, l;
 int j;
 System.out.println("----PERHITUGAN NILAI RATA-RATA MAHASISWA----");
 BufferedReader hit = new BufferedReader(new InputStreamReader(System.in));
 String a = "";
 String b = "";
 String c = "";
 String g = "";
 do {
 try {
 System.out.println("Masukan Nilai UAS : ");
 a = hit.readLine();
 h = Integer.parseInt(a);
 s = (float) (h * 0.5);
 System.out.println("hasil x 50 % \n = " + s);
 System.out.println("Masukan Nilai UTS : ");
 b = hit.readLine();
 k = Integer.parseInt(b);
 q = (float) (k * 0.3);
 System.out.println("hasil x 30 % \n = " + q);
 System.out.println("Masukan Nilai Tugas :");
 c = hit.readLine();
 t = Integer.parseInt(c);
 l = (float) (t * 0.2);
 System.out.println("hasil x 20 % \n = " + l);
 float u = (s + q + l / 3);
 System.out.println("Rata-Rata Nilai Mahasiswa adalah : " + u);
 if (u >= 80 && u < 100) {
 System.out.println("Anda Mendapat Nilai : A");
 } else if (u > 65 && u < 79) {
 System.out.println("Anda Mendapat Nilai : B");
 } else if (u > 40 && u < 64) {
 System.out.println("Anda Mendapat Nilai : C");
 } else if (u > 1 && u < 39) {
 System.out.println("Anda Mendapat Nilai : D");
 }
 } catch (Exception o) {
 System.out.println("ANDA SUDAH MEMBUAT ERROR ");
 }
 System.out.println("Apakah Anda ingin Mengulang Program ini ? 1/2");
 g = hit.readLine();
 j = Integer.parseInt(g);
 } while (j == 1);
 if (j == 2) {;
 System.exit(0);
 }
 }
}

 

Diterbitkan oleh

Taken

i need somebody for help me to make anything what i need

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s