Entri Populer

Minggu, 24 April 2011

Tugas 6 (Quiz)

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
main()
{
char nama[50],koka,kokel,*nakam,*kelas,*souv;
int hrg,lama,adm,tot;

cout<<"PENGINAPAN HOTEL MELATI"<<endl;
cout<<"----------------------------------------"<<endl;
cout<<"Nama Penyewa  = ";cin>>nama;
cout<<"Kode Kamar [A/B/C]= ";cin>>koka;
cout<<"Kode Kelas [1/2/3]= ";cin>>kokel;
cout<<"Lama Menginap  = ";cin>>lama;
cout<<"hari"<<endl;
cout<<"----------------------------------------"<<endl;

if (koka=='A'||koka=='a')
{nakam="Anyelir";
if (kokel=='1')
{kelas="VIP";
hrg=350000;}
else if (kokel=='2')
{kelas="KELAS 1";
hrg=250000;}
else if (kokel=='3')
{kelas="KELAS 2";
hrg=150000;}}

else if (koka=='B'||koka=='b')
{nakam="Cempaka";
if (kokel=='1')
{kelas="VIP";
hrg=500000;}
else if (kokel=='2')
{kelas="KELAS 1";
hrg=400000;}
else if (kokel=='3')
{kelas="KELAS 2";
hrg=300000;}}

else if (koka=='C'||koka=='c')
{nakam="Melati";
if (kokel=='1')
{kelas="VIP";
hrg=1000000;}
else if (kokel=='2')
{kelas="KELAS 1";
hrg=750000;}
else if (kokel=='3')
{kelas="KELAS 2";
hrg=650000;}}

if (lama>7)
souv="Free Lunch";
else
souv="No Souvenir!!";

adm=75000;

tot=(hrg*lama)+adm;
clrscr();
cout<<"PENGINAPAN SEDAYI INDAH"<<endl;
cout<<"----------------------------------------"<<endl;
cout<<"Nama Penyewa = "<<nama<<endl;
cout<<"Nama Kamar = "<<nakam<<endl;
cout<<"Kelas = "<<kelas<<endl;
cout<<"Lama Menginap = "<<lama;
cout<<" Hari"<<endl;
cout<<"Biaya Sewa =Rp "<<hrg<<endl;
cout<<"Biaya Administrasi =Rp "<<adm<<endl;
cout<<"Total Biaya Sewa =Rp "<<tot<<endl;
cout<<"----------------------------------------"<<endl;
cout<<"Souvenir = "<<souv<<endl;
getch();
}








download

Tidak ada komentar:

Posting Komentar