Thursday, 15 December 2011

program ayar kontrakkan


#include<conio.h>
#include<iostream.h>
#include<stdio.h>
main()
{
clrscr();
float harga,lama,bayar;
char pilih;
cout<<"Tarif Kamar Kontrakan"<<endl;
cout<<"1. tipe A= Rp. 1.000.000,-/bulan"<<endl;
cout<<"2. tipe B= Rp.   750.000,-/bulan"<<endl;
cout<<"3. tipe C= Rp.   500.000,-/bulan"<<endl;
cout<<"************************************"<<endl<<endl;
cout<<" Masukkan tipe kamar    = ";cin>>pilih;
cout<<" Lama sewa[dalam bulan] = ";cin>>lama;
if (pilih=='A'|| pilih=='a')
bayar=lama*1000000;
else if (pilih=='B'|| pilih=='b')
bayar=lama*750000;
else if(pilih=='C'|| pilih=='c')
bayar=lama*500000;
cout<<" \n Total bayar            = "<<bayar<<" Rupiah";
getch();
}

No comments:

Post a Comment