Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Muhammad Reza Nugraha

202143502326
R24
Pemrograman
/**
* Write a description of class a here.
*
* @author (Muhammad Reza Nugraha)
* @version (a version number or a date)
*/
public class PraktikumLimaBelas
{
public static void main(String []args){
String[] npm= {"1401","1402","1403","1404","1405"};
String[] nama = {"Amir","Budi","Cici","Doni","Elvi"};
double[] [] nil = {{ 60, 70, 90},{ 80, 70, 90},{ 70, 60, 90},
{ 80, 70, 60},{ 70, 60, 70}};
double nilai = 0;

System.out.println("+-------+-------+-------+-------+-------+---------------+");
System.out.println("I NPM \tI Nama\tI UTS \tI UAS \tI PRAK\tI Nilai Akhir\tI");
System.out.println("+-------+-------+-------+-------+-------+---------------+");

for(int i = 0; i < 5; i++){


System.out.print("I " + npm[i] + "\tI ");
System.out.print(nama[i] + "\tI ");
for(int j = 0; j < 3; j++){
System.out.print(nil[i] [j] + "\tI ");
}
nilai = (0.35 * nil[i] [0]) + (0.45 * nil[i] [1]) + (0.2 * nil[i] [2]);
System.out.println( nilai + "\t\tI ");
}
System.out.println("+-------+-------+-------+-------+-------+---------------+");
}
}
Outputnya :

You might also like