Selasa, 24 Juni 2014

Pemrograman Java : program kelulusan menggunakan array

Diposting oleh Unknown di 00.39
import javax.swing.JOptionPane;
public class Method {
public static String [] kelulusan (int nilai []){
String Ket [] = new String [10];
for (int i = 0; i < nilai.length; i++){
if (nilai[i] >= 50){
Ket[i] = "LULUS";
}else {
Ket[i] = "TIDAK LULUS";
}
}return Ket;
}

public static int[] nilai(char jwb[][], char kunci[]){
int nilai [] = new int [5];
for (int i = 0; i<jwb.length; i++){
int x=0;
for (int j = 0; j<jwb[i].length; j++)
{
if(jwb[i][j] == kunci[j]){
x++;
}
}
nilai[i]= x * 10;
}
return nilai;
}
}

0 komentar:

 

Miss Galaxy Yoon Template by Ipietoon Blogger Template | Gift Idea