- Buatlah program untuk menentukan total
pembayaran mahasiswa dalam 1 tahun dan jenis kuliah yang diambil, jika
diberlakukan kondisi sebagai berikut:
Kode
|
Keterangan
|
1
|
Kursus = “Komputer”
Jumlah = 50000*sks
Semester = Jumlah*2
|
2
|
Kursus = “Bahasa”
Jumlah = 30000*sks
Semester = Jumlah*2
|
3
|
Kursus = “Pajak”
Jumlah = 20000*sks
Semester = Jumlah*2
|
Jawab :
#include
<iostream>
#include
<conio.h>
using
namespace std;
main()
{
char kdmenu;
cout<<"Masukkan Kode 1 / 2 / 3
= ";
cin>>kdmenu;
kdmenu = toupper(kdmenu);
if (kdmenu =='1')
{cout<<"\nKomputer\n";
float SKS, JML, SEM;
cout<<"SKS =";
cin>>SKS;
JML = SKS*50000;
SEM = JML*2;
cout<<"\n++++++++++++++Hasil
Kursus Komputer++++++++++++++\n";
cout<<"Jumlah =
"<<JML;
cout<<"\nSemester =
"<<SEM;}
else if (kdmenu =='2')
{cout<<"\nBahasa\n";
float SKS, JML, SEM;
cout<<"SKS =";
cin>>SKS;
JML = SKS*30000;
SEM = JML*2;
cout<<"\n++++++++++++++Hasil
Kursus Bahasa++++++++++++++\n";
cout<<"Jumlah =
"<<JML;
cout<<"\nSemester =
"<<SEM;}
else if (kdmenu =='3')
{cout<<"\nPajak\n";
float SKS, JML, SEM;
cout<<"SKS =";
cin>>SKS;
JML = SKS*20000;
SEM = JML*2;
cout<<"\n++++++++++++++Hasil
Kursus Pajak++++++++++++++\n";
cout<<"Jumlah =
"<<JML;
cout<<"\nSemester =
"<<SEM;}
getch ();
}
No comments:
Post a Comment