Program Mencari Rata-rata nilai dengan JAVA




import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class rata2nilai
{
 public static void main(String [] args) throws Exception
 {
 BufferedReader bro = new BufferedReader (new InputStreamReader (System.in));
  System.out.println("\nMASUKKAN DATA MAHASISWA ");
  System.out.print("Nama Mahasiswa : ");
  String nama = bro.readLine();
  System.out.print("NIM : ");
  String NIM = bro.readLine();
  System.out.print("Kelas : ");
  String kelas = bro.readLine();
  System.out.print("Semester : ");
  String smstr = bro.readLine();
  System.out.println("\nMASUKKAN NILAI MAHASISWA ");
  System.out.print("Agama 1 (Aqidah) : ");
  String agm1 = bro.readLine();
  int agm = Integer.parseInt (agm1);
  System.out.print("Pengantar Teknologi Informasi dan Komunikasi : ");
  String ptik1 = bro.readLine();
  int ptik = Integer.parseInt (ptik1);
  System.out.print("Sistem Digital : ");
  String sd1 = bro.readLine();
  int sd = Integer.parseInt (sd1);
  System.out.print("Dasar Pemrograman : ");
  String dp1 = bro.readLine();
  int dp = Integer.parseInt (dp1);
  System.out.print("Pendidikan Pancasila : ");
  String pkn1 = bro.readLine();
  int pkn = Integer.parseInt (pkn1);
  System.out.print("Kalkulus 1 : ");
  String klks = bro.readLine();
  int kalkul = Integer.parseInt (klks);
  System.out.print("Bahasa Indonesia : ");
  String bi = bro.readLine();
  int bindo = Integer.parseInt (bi);
  
  
  System.out.println("\nDATA MAHASISWA ");
  System.out.println("---------------");
  System.out.println("Nama\t: "+nama);
  System.out.println("NIM\t: " +NIM);
  System.out.println("Kelas\t:"+kelas);
  System.out.println("Semester\t:"+smstr);
  System.out.println("\nNILAI");
  System.out.println("-----");
  System.out.println("Agama 1 (Aqidah)\t : "+agm);
  System.out.println("Pengantar TIK\t\t : "+ptik);
  System.out.println("Sistem Digital\t\t : "+sd);
  System.out.println("Dasar Pemrograman\t : "+dp);
  System.out.println("Pendidikan Pancasila\t : "+pkn);
  System.out.println("Kalkulus 1\t\t : "+kalkul);
  System.out.println("Bahasa Indonesia\t : "+bindo);
  System.out.println("\nNILAI RATA-RATA = "+ ((double)(agm + ptik +
  sd + dp + pkn + kalkul + bindo)) / 7 );

 }
}



Post a Comment

0 Comments