Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

073 #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 073/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"iostream": "cpp"
}
}
86 changes: 86 additions & 0 deletions 073/CASINO.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#include <iostream>
#include<string>
#include<cstdlib>
using namespace std;
int main(){
string player;
int amount;
int let;
int Dice;
char option;
int Amount_bid;
srand(time(0));
cout<<"\t\t DOUBLE YOUR MONEY";
cout<<"\n Enter the name of the player:";
getline(cin,player);
cout<<"\n enter the initial amount to deposite::$";
cin>>amount;
do{
system("cls");

do{
cout<<"\n welcome"<<endl<<player<<"-->Ready to play"<<endl<<endl;
cout<<"Enter Bid Amount::$";
cin>>Amount_bid;
if(Amount_bid>amount){
cout<<"you cannot bid amount higher than::"<<amount<<endl<<endl;
cout<<"Re-enter your bid amount";
}
}while(Amount_bid>amount);



do{
cout<<" guess a number from 1 to 10"<<endl<<endl;
cin>>let;

if (let<=0 || let>10){
cout<<"you cannot choose the number greater than 10!"<<endl<<"try again"<<endl<<endl;
}
}while(let<=0 || let>10);

Dice=rand()%10+2;

if(Dice==let){
cout<<"CONGRALUTION YOU WON::"<<let*5<<endl<<endl;
amount=amount+Amount_bid*5;
cout<<endl;
cout<<"your total amount::"<<amount<<endl<<endl;

}
else{
cout<<"you loose::"<<Amount_bid<<"$\n";


cout<<"the winning number was::"<<Dice<<endl<<endl;
amount=amount-Amount_bid;
cout<<"Your balance::"<<amount<<endl;
}

if (amount==0){
cout<<" Insufficient Amount!!"<<endl<<endl;
break;
}


cout<<endl<<endl<<"Do you want to bid again(y/n)?"<<endl;
cin>>option;

}while (option=='Y'|| option =='y');

cout<<"Thank you for playing this again \n\n Your current amount is::"<<amount<<endl;

return (0);
}












Binary file added 073/CASINO.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions 073/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Author:
Name: Suraj Neupane \
Roll:ACE079BCT073