Nama : Wahyu Abadi
Nim : 12084323
Kelas : 12.6g
jawaban soal tipe B
hasilnya
Nim : 12084323
Kelas : 12.6g
jawaban soal tipe B
# include<conio.h>
# include<stdio.h>
# include<iostream.h>
main()
{
char nm[20],tp[3],pbr,*pembayaran,*tipe;
int lt,ttl,hrg,hrgb,hrgt,hrgba,adm,pot,kbli,bay;
cout<<endl;
cout<<endl;
cout<<" Perumahan Nirwana"<<endl;
cout<<" CV. Angin Makmur Sentosa"<<endl;
cout<<" Jl. Raya Citayam No. 30 Depok"<<endl;
cout<<"--------------------------------------"<<endl;
cout<<" Nama Pembeli = ";cin>>nm;
cout<<" Type [RS|MN|MW] = ";cin>>tp;
cout<<" Pembayaran [1|2] = ";cin>>pbr;
cout<<"--------------------------------------"<<endl;
if(strcmpi(tp,"RS")==0)
{
tipe="Sederhana";
lt=150;
hrg=75000;
hrgb=100000;
}
else if(strcmpi(tp,"MN")==0)
{
tipe="Menengah";
lt=300;
hrg=1000000;
hrgb=350000;
}
else if(strcmpi(tp,"MW")==0)
{
tipe="Mewah";
lt=350;
hrg=1500000;
hrgb=400000;
}
hrgt=lt*hrg;
hrgba=lt*hrgb;
adm=500000;
if(pbr=='1')
{
pembayaran="Cash";
pot=0.1*(hrgt+hrgba);
}
else
{
pembayaran="Kredit";
pot=0.05*(hrgt+hrgba);
}
ttl=(hrgt+hrgba+adm)-pot;
clrscr();
cout<<endl;
cout<<endl;
cout<<" PROGRAM PENJUALAN RUMAH \"NIRWANA\""<<endl;
cout<<"---------------------------------"<<endl;
cout<<" Nama Pembeli : "<<nm<<endl;
cout<<" Tipe Rumah : "<<tipe<<endl;
cout<<" Pembayaran : "<<pembayaran<<endl;
cout<<" Harga Tanah : Rp. "<<hrg<< "x" <<lt<< "m2 = Rp "<<hrgt<<endl;
cout<<" Harga Bangunan : Rp. "<<hrgb<< "x" <<lt<< "m2 = Rp "<<hrgt<<endl;
cout<<" Biaya ADM : "<<adm<<endl;
cout<<" Potongan : "<<pot<<endl;
cout<<" Total : "<<ttl<<endl;
cout<<"----------------------------------"<<endl;
cout<<" Uang Bayar : ";cin>>bay;
kbli=bay-ttl;
cout<<" Uang Kembali : "<<kbli<<endl;
getch();
}
hasilnya