algoritma dan pemrograman

public class konversi {
public static void main (String [] args){
raimawan a = new raimawan ();
a.NA = 82;
a.grade ();
raimawan b = new raimawan ();
b.NA = 24 ;
b.grade ();
hari c = new hari ();
c.NB= 5;
c.hari ();

}

}

class raimawan {
int NA;
String NH;
void grade(){
if (NA>75)
NH = “A”;
else if (NA > 50)
NH = “B”;
else
NH =”D”;
System.out.println (“Nilai Angka “+NA);
System.out.println (“Nilai Huruf”+NH);
}
}

class hari{
int NB;
String NC;
void hari (){
if (NB==1)
NC = “senin”;
else if (NB==2)
NC = “selasa”;
else if (NB==3)
NC =”rabu”;
else if (NB==4)
NC =”ksmis”;
else if (NB==5)
NC =”jum’at”;
else if (NB==6)
NC =”sabtu”;
else if (NB==7)
NC =”minggu”;
System.out.println (“Nama Hari “+NC);

}
}

Tentang raimawan

uchull
Pos ini dipublikasikan di Uncategorized. Tandai permalink.

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