Program Game Kuis Menggunakan C++


#include<iostream.h>
#include<conio.h>
void main()
{
char tanya,amn;
int jwb;
long int nilai=100000,uang=0,jlh;
gotoxy(25,10);cout<<"================================\n";
gotoxy(25,11);cout<<"   KUIS SIAPA MAU JADI JUTAWAN\n";
gotoxy(25,12);cout<<"================================\n";
gotoxy(25,14);cout<<"Anda Ingin Bermain ? [Y/T] : ";cin>>tanya;
if(tanya=='y' || tanya=='Y')
{
for(int hsl=1; hsl<=5; hsl++)
{
clrscr();
gotoxy(3,3);cout<<"=====================================";
gotoxy(3,4);cout<<"Pertanyaan No."<<hsl<<" Bernilai Rp."<<nilai;
gotoxy(3,5);cout<<"=====================================";
gotoxy(50,16);cout<<"-----------------------------";
gotoxy(50,17);cout<<"Pertanyaan No.1 : Rp.  100000";
gotoxy(50,18);cout<<"Pertanyaan No.2 : Rp.  500000";
gotoxy(50,19);cout<<"Pertanyaan No.3 : Rp. 1000000";
gotoxy(50,20);cout<<"Pertanyaan No.4 : Rp. 5000000";
gotoxy(50,21);cout<<"Pertanyaan No.5 : Rp.10000000";
gotoxy(50,22);cout<<"-----------------------------";
if(hsl==1)
{
gotoxy(3,7);cout<<"Warna Bendera Indonesia ";
gotoxy(3,9);cout<<"1. Merah Putih";
gotoxy(3,10);cout<<"2. Biru Merah";
gotoxy(3,12);cout<<"Jawaban [1/2] : ";cin>>jwb;
if(jwb==1)
{
jlh=nilai;
nilai=nilai+400000;}
else
{
clrscr();
gotoxy(30,10);cout<<"Jawaban Salah, Permainan Berakhir";
gotoxy(30,12);cout<<"Terima Kasih Telah Bermain";
getch();
break; }
}
else if(hsl==2)
{
gotoxy(3,7);cout<<"Singkatan Nama Presiden Indonesia ";
gotoxy(3,9);cout<<"1. SBY";
gotoxy(3,10);cout<<"2. SBH";
gotoxy(3,12);cout<<"Jawaban [1/2] : ";cin>>jwb;
if(jwb==1)
{
clrscr();
jlh=nilai;
nilai=nilai*2;}
else
{
clrscr();
gotoxy(30,10);cout<<"Jawaban Salah, Permainan Berakhir";
gotoxy(30,12);cout<<"Anda Hanya Mendapat Rp."<<jlh;
getch();
break; }
}
else if(hsl==3)
{
gotoxy(3,7);cout<<"Lagu Kebangsaan Negara Indonesia ";
gotoxy(3,9);cout<<"1. Indonesia Raya";
gotoxy(3,10);cout<<"2. Maju Tak Gentar";
gotoxy(3,12);cout<<"Jawaban [1/2] : ";cin>>jwb;
if(jwb==1)
{
uang=jlh+nilai;
nilai=nilai*5;}
else
{
clrscr();
gotoxy(30,10);cout<<"Jawaban Salah, Permainan Berakhir";
gotoxy(30,12);cout<<"Anda Hanya Mendapat Rp."<<nilai;
getch();
break; }
}
else if(hsl==4)
{
clrscr();
gotoxy(25,10);cout<<"Selamat, Anda Telah Memasuki Titik AMAN";
gotoxy(25,12);cout<<"Anda Ingin Melanjutkan ? [Y/T] : ";cin>>amn;
if(amn=='t' || amn=='T')
{
clrscr();
gotoxy(36,10);cout<<"G A M E  O V E R";
gotoxy(30,12);cout<<"Terima Kasih Telah Bermain";
gotoxy(30,14);cout<<"Anda Mendapat Uang Rp. "<<jlh;
getch();
break;
}
else
{
clrscr();
gotoxy(3,3);cout<<"=====================================";
gotoxy(3,4);cout<<"Pertanyaan No."<<hsl<<" Bernilai Rp."<<nilai;
gotoxy(3,5);cout<<"=====================================";
gotoxy(50,16);cout<<"-----------------------------";
gotoxy(50,17);cout<<"Pertanyaan No.1 : Rp.  100000";
gotoxy(50,18);cout<<"Pertanyaan No.2 : Rp.  500000";
gotoxy(50,19);cout<<"Pertanyaan No.3 : Rp. 1000000";
gotoxy(50,20);cout<<"Pertanyaan No.4 : Rp. 5000000";
gotoxy(50,21);cout<<"Pertanyaan No.5 : Rp.10000000";
gotoxy(50,22);cout<<"-----------------------------";
gotoxy(3,7);cout<<"Lambang Negara Indonesia ";
gotoxy(3,9);cout<<"1. Burung Merpati";
gotoxy(3,10);cout<<"2. Burung Garuda";
gotoxy(3,12);cout<<"Jawaban [1/2] : ";cin>>jwb;
if(jwb==2)
{
uang=jlh+nilai;
nilai=nilai*2; }
else
{
clrscr();
gotoxy(30,10);cout<<"Jawaban Salah, Permainan Berakhir";
gotoxy(30,12);cout<<"Terima Kasih Telah Bermain";
gotoxy(30,14);cout<<"Anda Mendapat Uang Rp. "<<jlh;
getch();
break; }
}
}
else if(hsl==5)
{
gotoxy(3,7);cout<<"Bahasa Yang Digunakan Negara Indonesia ";
gotoxy(3,9);cout<<"1. Bahasa Batak ";
gotoxy(3,10);cout<<"2. Bahasa Indonesia";
gotoxy(3,12);cout<<"Jawaban [1/2] : ";cin>>jwb;
if(jwb==2)
{
uang=nilai;
nilai=nilai*2;
clrscr();
gotoxy(30,10);cout<<"SELAMAT ANDA MENJADI JUTAWAN BARU";
gotoxy(30,12);cout<<"Anda Mendapat Uang Rp. "<<uang;
getch();
}
else
{
clrscr();
gotoxy(30,10);cout<<"Jawaban Salah, Permainan Berakhir";
gotoxy(30,12);cout<<"Terima Kasih Telah Bermain";
gotoxy(30,14);cout<<"Anda Mendapat Uang Rp. "<<jlh;
getch();
break; }
}
}
}
else
{
getch();
}
}


Previous
Next Post »

1 comments:

Write comments
Anonymous
AUTHOR
Saturday, May 06, 2017 10:32:00 AM delete

Bang kok gagal yah?

Reply
avatar