#include <iostream>
using namespace std;
struct maha
{
char nim[10];
char nama[25];
char kelamin[10];
int semester, pilih, ambil;
int sks;
long spp;
};
struct maha MS[10];
int main()
{
int i,qty;
struct siswa
{
int tetap, var;
}
A,B;
A.tetap = 500000;
A.var = 25000;
B.tetap = 750000;
B.var = 50000;
cout<<"================================="<<endl;
cout<<"1. D3"<<endl;
cout<<"\tSpp Tetap : Rp."<<A.tetap;
cout<<"\n\tSpp Var : Rp."<<A.var;
cout<<"\n\n2. S1"<<endl;
cout<<"\tSpp Tetap : Rp."<<B.tetap;
cout<<"\n\tSpp Var : Rp."<<B.var<<endl;
cout<<"================================="<<endl;
cout<<"Berapa Mahasiswa : ";cin>>qty;
for (i=0;i<qty;i++)
{
cout<<"\nMahasiswa ke-"<<i+1<<endl;
cout<<"\nApakah yang ingin anda pilih (1/2): ";cin>>MS[i].pilih;
if (MS[i].pilih == 1)
{
cout<<"Berapa anda ambil SKS : ";cin>>MS[i].ambil;
MS[i].sks=25000*MS[i].ambil;
MS[i].spp=500000+MS[i].sks;
}
else if (MS[i].pilih == 2)
{
cout<<"Berapa anda ambil SKS : ";cin>>MS[i].ambil;
MS[i].sks=50000*MS[i].ambil;
MS[i].spp=750000+MS[i].sks;
}
cout<<"\nInput Data mahasiswa :\n";
cout<<"Nim : ";cin>>MS[i].nim;
cout<<"Nama : ";cin>>MS[i].nama;
cout<<"Semester : ";cin>>MS[i].semester;
cout<<"Jenis Kelamin : ";cin>>MS[i].kelamin;
cout<<endl;
}
for (i=0;i<qty;i++)
{
cout<<"==============================="<<endl;
cout<<"\tDATA MAHASISWA"<<endl;
cout<<"==============================="<<endl;
cout<<"Nim : "<<MS[i].nim<<endl;
cout<<"Nama : "<<MS[i].nama<<endl;
cout<<"Semester : "<<MS[i].semester<<endl;
cout<<"Jenis Kelamin : "<<MS[i].kelamin<<endl;
cout<<"Spp : "<<MS[i].spp<<endl;
cout<<"==============================="<<endl;
}
return 0;
}
using namespace std;
struct maha
{
char nim[10];
char nama[25];
char kelamin[10];
int semester, pilih, ambil;
int sks;
long spp;
};
struct maha MS[10];
int main()
{
int i,qty;
struct siswa
{
int tetap, var;
}
A,B;
A.tetap = 500000;
A.var = 25000;
B.tetap = 750000;
B.var = 50000;
cout<<"================================="<<endl;
cout<<"1. D3"<<endl;
cout<<"\tSpp Tetap : Rp."<<A.tetap;
cout<<"\n\tSpp Var : Rp."<<A.var;
cout<<"\n\n2. S1"<<endl;
cout<<"\tSpp Tetap : Rp."<<B.tetap;
cout<<"\n\tSpp Var : Rp."<<B.var<<endl;
cout<<"================================="<<endl;
cout<<"Berapa Mahasiswa : ";cin>>qty;
for (i=0;i<qty;i++)
{
cout<<"\nMahasiswa ke-"<<i+1<<endl;
cout<<"\nApakah yang ingin anda pilih (1/2): ";cin>>MS[i].pilih;
if (MS[i].pilih == 1)
{
cout<<"Berapa anda ambil SKS : ";cin>>MS[i].ambil;
MS[i].sks=25000*MS[i].ambil;
MS[i].spp=500000+MS[i].sks;
}
else if (MS[i].pilih == 2)
{
cout<<"Berapa anda ambil SKS : ";cin>>MS[i].ambil;
MS[i].sks=50000*MS[i].ambil;
MS[i].spp=750000+MS[i].sks;
}
cout<<"\nInput Data mahasiswa :\n";
cout<<"Nim : ";cin>>MS[i].nim;
cout<<"Nama : ";cin>>MS[i].nama;
cout<<"Semester : ";cin>>MS[i].semester;
cout<<"Jenis Kelamin : ";cin>>MS[i].kelamin;
cout<<endl;
}
for (i=0;i<qty;i++)
{
cout<<"==============================="<<endl;
cout<<"\tDATA MAHASISWA"<<endl;
cout<<"==============================="<<endl;
cout<<"Nim : "<<MS[i].nim<<endl;
cout<<"Nama : "<<MS[i].nama<<endl;
cout<<"Semester : "<<MS[i].semester<<endl;
cout<<"Jenis Kelamin : "<<MS[i].kelamin<<endl;
cout<<"Spp : "<<MS[i].spp<<endl;
cout<<"==============================="<<endl;
}
return 0;
}
Comments
Post a Comment