In: Computer Science
Please submit a topic and your project plan.
There are no limits on project plan, the intent is to get you started.
The details you should include are - what your project will look like, what features it will include (and/ or exclude), how will the user I/O be etc. If you are very ahead of schedule, you can also add an algorithm.
Could you make project topic and plan from c+ program
Project topic using C++ is: The Casino guessing Game
Project Idea:
In this game, The player has to enter money to bet in a casino guessing game. The player has to guess a number between 1 to 10 and in the back-end their is a computer generated number which is generated with the help of rand() function. If the player guesses the right answer then he will be rewarded with 10 times of money which he bets. And, If he loses then he will lose his betting amount.
Here the C++ Code and Url link of the code , you can just copy and paste the url in your browser if you want the code or else you can see the code in the code snippet below , the output screen is also attached below the code:
Url link of C++ code: https://repl.it/repls/HeavenlyPunctualAstrophysics#main.cpp
C++ code snippet:
//This header file includes every header file in C++
#include<bits/stdc++.h>
using namespace std;
void rules_game();
void draw_partition(int n, char symbol);
int main()
{
string player_Name;
int amount; // hold's the player's amount
int dice; // hold the number which is generated by computer
int bet_Amount, guess;
char choice;
srand(time(0)); // seeds the random number generator
draw_partition(50,'$');
cout << "\n\n\t\tCASINO GAME\n\n\n";
draw_partition(50,'$');
cout << "\n\nEnter Your Name : ";
getline(cin, player_Name);
cout << "\n\nEnter Deposit amount to play game : $";
cin >> amount;
do
{
system("cls");
rules_game();
cout << "\n\nYour current balance is $ " << amount << "\n";
// Getting the player's betting amount
do
{
cout <<player_Name<<", enter money to bet : $ ";
cin >> bet_Amount;
if(bet_Amount > amount)
cout << "Your betting amount is more than your current balance\n"
<<"\nRe-enter data\n ";
}
while(bet_Amount > amount);
// Getting player's numbers
do
{
cout << "Guess your number between 1 to 10 to bet:";
cin >> guess;
if(guess <= 0 || guess > 10)
cout << "Please check the number!! should be between 1 to 10\n"
<<"\nRe-enter data\n ";
}while(guess <= 0 || guess > 10);
dice = ((rand()%10) + 1); // Will hold the randomly generated integer between 1 and 10
if(dice == guess)
{
cout << "\n\nGood Luck!!!!, You won Rs." << bet_Amount * 10;
amount = amount + bet_Amount * 10;
}
else
{
cout << "Bad Luck this time !! You lost $ "<< bet_Amount <<"\n";
amount = amount - bet_Amount;
}
cout << "\nThe winning number was : " << dice <<"\n";
cout << "\n"<<player_Name<<", You have $ " << amount << "\n";
if(amount == 0)
{
cout << "You don't have enough money to play";
break;
}
cout << "\n\n-->Do you want to play again (y/n)? ";
cin >> choice;
}
while(choice =='Y'|| choice=='y');
cout << "\n\n";
draw_partition(50,'=');
cout << "\n\nThank you for playing. Your current balance is $ " << amount << "\n\n";
draw_partition(50,'=');
return 0;
}
//function definition
void draw_partition(int n, char symbol)
{
for(int i=0; i<n; i++)
cout << symbol;
cout << "\n" ;
}
void rules_game()
{
system("cls");
cout << "\n\n";
draw_partition(50,'$');
cout << "\t\tRULES OF THE GAME\n";
draw_partition(50,'$');
cout << "\t 1. You have to guess any number between 1 to 10\n";
cout << "\t 2. If you bet on right number you will receive 10 times of money you bet\n";
cout << "\t 3. If you bet on wrong number you will lose your betting money\n\n";
draw_partition(50,'$');
}
Output screen:
Thank you!!!