menu 1
Menu 2
menu 3
void main(){
int x,p,i,f,t,j,n,k,data[9],min=999,max=-999,rat,jum=0;
char nm[15];
char indeks;
do {
clrscr();
cout<<"^^^^^^^^^^MENU^^^^^^^^^"<
cout<<": 1. Bioskop :"<
cout<<": 2. Segitiga Angka :"<
cout<<": 3. Menghitung Nilai :"<
cout<<": 4. Exit :"<
cout<<"^^^^^^^^^^^^^^^^^^^^^^^"<
cout<<"\n Masukan pilihan : "; cin>>x;
switch(x){
case 1:
do{
clrscr();
cout<<"selamat datang di BIOSKOP LEMPAR GRANAD"<
cout<<":------------:---------------:---------------:"<
cout<<": studio 1 : studio 2 : studio 3 :"<
cout<<":------------:---------------:---------------:"<
cout<<": iron man 2 : Dikejar Hantu : Eat Pray Love :"<
cout<<":------------:---------------:---------------:"<
cout<<"\nMasukan nama anda : "; cin>>nm;
cout<<"\nPilih studio : "; cin>>p;
switch(p){
case 1:
clrscr();
cout<<"\nHallo "<
cout<<"\nnama film : Iron Man 2"<
cout<<"jam tayang : 1. 12.00-14.30"<
cout<<" : 2. 15.00-17.30"<
cout<<" : 3. 18.00-20.30"<
cout<<"HTM : Rp. 15.000"<
cout<<"\nPilih jam tayang : "; cin>>f;
cout<<"\nBanyak tiket : "; cin>>t;
j=t*15000;
cout<<"\nTotal pembayaran : "<
cout<<"\nTerima Kasih "<
break;
case 2:
clrscr();
cout<<"\nHallo "<
cout<<"\nnama film : Dikejar Hantu"<
cout<<"jam tayang : 1. 12.00-14.30"<
cout<<" : 2. 15.00-17.30"<
cout<<" : 3. 18.00-20.30"<
cout<<"HTM : Rp. 15.000"<
cout<<"\nPilih jam tayang : "; cin>>f;
cout<<"\nBanyak tiket : "; cin>>t;
j=t*15000;
cout<<"\nTotal pembayaran : "<
cout<<"\nTerima Kasih "<
break;
case 3:
clrscr();
cout<<"\nHallo "<
cout<<"\nama film : Eat Pray Love"<
cout<<"jam tayang : 1. 12.00-14.30"<
cout<<" : 2. 15.00-17.30"<
cout<<" : 3. 18.00-20.30"<
cout<<"HTM : Rp. 15.000"<
cout<<"\nPilih jam tayang : "; cin>>f;
cout<<"\nBanyak tiket : "; cin>>t;
j=t*15000;
cout<<"\nTotal pembayaran : "<
cout<<"\nTerima Kasih "<
break;
}
cout<<"\nMau diulang (y/n) ? "; cin>>indeks;
}while(indeks!='n');
break;
case 2:
do{
clrscr();
cout<<"program segitiga angka"<
cout<<"----------------------"<
cout<<"masukan banyak angka : "; cin>>n;
for(i=1;i<=n;i++){
k=0;
for(j=1;j<=i;j++){
k=k+i;
cout<
}
cout<
}
cout<<"\nMau diulang (y/n) ? "; cin>>indeks;
}while(indeks!='n');
break;
case 3:
do{
clrscr();
cout<<"menghitung nilai"<
cout<<"----------------"<
cout<<"input data"<
cout<<"----------"<
cout<<"masukan banyaknya data : ";cin>>n;
cout<
for(i=1;i<=n;i++){
cout<<"nilai ke-"<>data[i];
}
for(i=1;i<=n;i++){
if(data[i]
min=data[i];
}
else if(data[i]>max){
max=data[i];
}
jum = jum+data[i];
}
rat=jum/n;
cout<<"\nnilai maksimum : "<
cout<<"nilai minimum : "<
cout<<"jumlah : "<
cout<<"rata-rata : "<
cout<<"\nMau diulang (y/n) ? "; cin>>indeks;
}while(indeks!='n');
break;
}
}while(x!=4);
getch();
}
download cpp
Tidak ada komentar:
Posting Komentar