Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

Jawaban ujian MID. #include int pil; char tny; main(){ menu: cout<<"\nMENU PILIHAN : "; cout<<"\n[1] Hitung IPK Mahasiswa"; cout<<"\n[2] Hitung Gaji Karyawan";

Presentasi serupa


Presentasi berjudul: "Jawaban ujian MID. #include int pil; char tny; main(){ menu: cout<<"\nMENU PILIHAN : "; cout<<"\n[1] Hitung IPK Mahasiswa"; cout<<"\n[2] Hitung Gaji Karyawan";"— Transcript presentasi:

1 Jawaban ujian MID

2 #include int pil; char tny; main(){ menu: cout<<"\nMENU PILIHAN : "; cout<<"\n[1] Hitung IPK Mahasiswa"; cout<<"\n[2] Hitung Gaji Karyawan"; cout<<"\n[3] Keliuar Dari Aplikasi"; cout >pil;

3 switch(pil) {case 1: {int n,sks=0,tsks=0; char mkul[20],ket; float nilai=0,rata,jml=0,ipk=0; cout >n; for(int i=1;i<=n;i++){ cout<<"\n\nData ke = "<

4 nilai+=(2*sks); else if(ket=='D' || ket=='d') nilai+=(1*sks); else if(ket=='E' || ket=='e') nilai+=(0*sks); else cout<<"Range nilai hanya dari A-E"; tsks+=sks; ipk=nilai/tsks; } cout<<"\nNilai total = "<tny; if(tny=='y' ||tny=='Y') {clrscr(); goto menu;}}

5 case 2: {char nama_karyawan[20],nik[5],gol; float gator,pajak,gaber,gapok,tunj,makan,trans; bool status,kelamin,kendaraan; cout<<"\n*************************************"; cout<<"\n* MENGHITUNG GAJI BERSIH KARYAWAN *"; cout<<"\n*************************************"; cout<nik; cout >kelamin; cout >status; cout >kendaraan; cout >gol; cout >makan; if (gol=='a' || gol=='A') gapok=500; else if (gol=='b' || gol=='B')

6 gapok=600; else if (gol=='a' || gol=='A') gapok=700; cout<<"\nGaji pokok anda : Rp "<

7 gaber=gator-pajak; cout<<"\nGaji kotornya : Rp "<tny; if(tny=='y' ||tny=='Y') {clrscr(); goto menu;} } default: return 0;} getch();}


Download ppt "Jawaban ujian MID. #include int pil; char tny; main(){ menu: cout<<"\nMENU PILIHAN : "; cout<<"\n[1] Hitung IPK Mahasiswa"; cout<<"\n[2] Hitung Gaji Karyawan";"

Presentasi serupa


Iklan oleh Google