Semoga bermanfaat ^_^
Studi Kasus :
Buatlah program untuk menghitung spp mahasiswa
dengan struktur
Diketahui:
·
D3 spp
tetap Rp 500.000,-
spp
var Rp 25.000,-
·
S1 spp
tetap Rp 750.000,-
spp
var Rp 50.000
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
main()
{
char nama[20],nim[10],sem[3],mkul[20],ket[10];
int
jml_mkul,sks,tsks=0,biaya_sks,spp_tetap,spp_var,ttl_bayar,jurusan,ttl_byr;
cout<<"PROGRAM
MENGHITUNG PEMBAYARAN SPP\n\n";
cout<<"Input nama\t: ";gets(nama);
cout<<"Input nim\t:
";cin>>nim;
cout<<"Semester\t:
";cin>>sem;
cout<<"Jurusan\t\t: ";
cout<<"\n0 : D3 MI";
cout<<"\n1 : D3 TK";
cout<<"\n2 : S1 Bio";
cout<<"\n3 : S1 Hk\n";
cout<<"Pilih jurusan\t:
";cin>>jurusan;
cout<<"\nJumlah mata kuliah\t:
";cin>>jml_mkul;
cout<<"\n==DATA MATA KULIAH== ";
for(int i=1;i<=jml_mkul;i++)
{
cout<<"\nMata kuliah\t: ";cin>>mkul;
cout<<"Jumlah sks\t: ";cin>>sks;
tsks+=sks;
}
if(jurusan==0 || jurusan==1)
{biaya_sks=25000;
spp_tetap=500000;}
else if(jurusan==2 || jurusan==3)
{biaya_sks=50000;
spp_tetap=750000;}
spp_var=biaya_sks*tsks;
ttl_byr=spp_var+spp_tetap;
clrscr();
cout<<"==BIAYA SPP MAHASISWA==";
cout<<"\nInput nama\t\t:
"<<nama;
cout<<"\nInput nim\t\t:
"<<nim;
cout<<"\nSemester\t\t:
"<<sem;
if(jurusan==0)
cout<<"\nJurusan\t\t\t: D3 MI";
else if(jurusan==1)
cout<<"\nJurusan\t\t\t: D3 TK";
else if(jurusan==2)
cout<<"\nJurusan\t\t\t: S1 Bio";
else if(jurusan==3)
cout<<"\nJurusan\t\t\t: S1 Hk";
else
cout<<"\nJurusan\t\t\t: Tidak ada";
cout<<"\nTotal SKS\t\t:
"<<tsks;
cout<<"\nBiaya per SKS\t\t:
"<<biaya_sks;
cout<<"\nSPP Variabel\t\t:
"<<spp_var;
cout<<"\nSPP Tetap\t\t:
"<<spp_tetap;
cout<<"\nTotal bayar\t\t:
"<<ttl_byr;
getch();
}
Tidak ada komentar:
Posting Komentar