SHARE
TWEET

Main_Class.java

a guest Oct 13th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2.  
  3. public class Main_Class {
  4.     static Scanner masuk = new Scanner(System.in);
  5.     static Proses panggil = new Proses();
  6.     static String nama = "";
  7.     static String NPM = "";
  8.     public static void main(String[] args) {
  9.         String[] Matkul = {"Robotika I", "Mikrokontroller", "Algoritma Pemrograman", "Basis Data", "Struktur Data",
  10.                 "Interfacing","Sensor dan Tranduser", "Mekatronika"};
  11.         System.out.print("Masukkan Nama Mawasiswa : ");
  12.         nama+=masuk.nextLine();
  13.         System.out.print("Masukkan NPM          : ");
  14.         NPM+=masuk.nextLine();
  15.         for(int i=0;i<Matkul.length;i++){
  16.             System.out.println("Matakuliah "+Matkul[i]);
  17.             System.out.print("UTS : ");
  18.             int Nilai = masuk.nextInt();
  19.             System.out.print("UAS : ");
  20.             int NilaiUAS = masuk.nextInt();
  21.             panggil.addNode(Matkul[i], Nilai, NilaiUAS);
  22.         }
  23.         pilihan();
  24.     }
  25.     public static void pilihan(){
  26.         System.out.println("Pilih Operasi");
  27.         System.out.println("1. Hapus Data");
  28.         System.out.println("2. Edit Data");
  29.         System.out.println("3. Cetak Data");
  30.         System.out.print("Masukkan pilihan : ");
  31.         int pilihan = masuk.nextInt();
  32.         if(pilihan == 1){
  33.             System.out.println("Preview Data");
  34.             cetak();
  35.             System.out.println("");
  36.             System.out.print("Masukkan node yang ingin dihapus (1-8) : ");
  37.             int hapus = masuk.nextInt();
  38.             panggil.delete(hapus);
  39.             System.out.println("Data pada node "+hapus+" telah dihapus : ");
  40.             cetak();
  41.         } else if(pilihan == 2){
  42.             System.out.println("Edit");
  43.         } else if(pilihan == 3){
  44.             cetak();
  45.         }
  46.     }
  47.    
  48.     public static void cetak(){
  49.         String leftstr = "| %-53s | %n";
  50.         System.out.format("+-------------------------------------------------------+%n");
  51.         System.out.format("|                      Cetak Nilai                      |%n");
  52.         System.out.format("+-------------------------------------------------------+%n");
  53.         System.out.format(leftstr," Nama     : "+nama);
  54.         System.out.format(leftstr," NPM      : "+NPM);
  55.         System.out.format("+-----+-------------------------+-----------+-----------+%n");
  56.         System.out.format("| No. |       Mata Kuliah       |    UTS    |    UAS    |%n");
  57.         System.out.format("+-----+-------------------------+-----------+-----------+%n");
  58.         panggil.display();
  59.     }
  60.  
  61. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top