You are helping a corporation create a new system for keeping track of casinos and customers. The system will be able to record and modify customer and casino information. It will also be able to simulate games in the casino. You may complete this project individually or in a group of no more than 2 other people. Requirements do not change if you choose to complete the project individually or as part of a group.
Customer-specific requirements
You can create new customers
All new customers have a new customerID assigned to them, starting with 1 for the first, 2 for the second, 3 for the third, ect.
New customers have names and monetary balances
Default values are “default customer” for name and 1000 for balance
You can add or subtract from a customer’s balance
Customer balances cannot go below 0
You can change a customer’s name
You can display a customer’s name and his or her balance
Casino-specific requirements
You can create a new casino
All new casinos have a new casinoID assigned to them, starting with 1 for the first, 2 for the second, 3 for the third, ect.
New casinos have names and monetary balances
Default values are “default casino” for name and 50000 for balance
You can add or subtract from a casino’s balance
Casino balances cannot go below 0
Casinos offer 4 different games that customers can play
Twenty-one
High Low
Seven-Eleven
Slots
You can change a casino’s name
Changing a casino’s name subtracts the casino’s balance by 15000
You can display a casino’s name and its balance
Game requirements
All casino games are played by a customer against the casino. In games with dealers, the dealers represent the casino.
Any bets placed by the user and casino are deducted from the respective balances of both parties
Lost bets are added to the casino balance.
Amounts lost by the casino are deducted from the casino balance and added to the customer’s balance.
If a bet would cause either a casino or customer balance to go negative, that bet cannot be placed.
Bets cannot be 0 or negative.
Seven-Eleven
The game is played with dice. The objective of the game is to roll a seven or an eleven first.
Gameplay as follows:
The user makes a bet, the casino matches the amount to create the pot
The user and the casino each roll 2 six-sided dice simultaneously. The sum of both die is that player's total
If a player rolls a 7 or 11 and the other does not, the player with the 7 or 11 wins
If neither player rolls a 7 or 11, roll again
If both players roll a 7 or if both players roll an 11, roll again
If one player rolls a 7 and the other rolls an 11, the one who rolled an 11 wins
The winner wins the pot and adds the money to their balance
Twenty-One
The game is played with cards. Number cards (2,3,4,5,6,7,8,9,10) are worth their shown values. Other cards (Jack, Queen, King, Ace) are worth 10. The objectives of the game are to get cards as close to the value of 21 without going over and to beat the dealer. Assume the casino is using multiple decks for Twenty-One. Duplicates can be drawn in the same game.
Gameplay is as follows:
The user makes a bet, the casino matches the amount to create the pot
2 cards are dealt to the player, 2 cards are dealt to the dealer
The user can see both of their cards and one of the dealer’s cards
The user can choose to either draw a new card or stay with their current hand
If a user chooses to draw and their hand total exceeds 21, the casino wins
Once the user chooses to stay, the dealer will either draw a new card or stay
If the dealer’s hand is 17 or higher, they stay. If it is lower than 17, they draw
If the dealer draws and their hand total exceeds 21, the user wins
If both the dealer and the user stay, the totals are compared and the higher total wins
In case of a tie, the customer receives the initial bet back
The winner wins the pot and adds the money to their balance
Slots
Gameplay as follows:
The user is asked for the number of spins
Every spin costs the customer 5, this is added to the casino balance
Each spin, one of the following outcomes occurs:
70% chance to win 1 from the casino
20% chance to win 5 from the casino
9% chance to win 10 from the casino
1% chance to win 100 from the casino
Display the amount the user won
Repeat steps 2 to 4 until the number of spins are complete
High Low
The game is played with cards. The rank of the cards from low to high is as follows: A,2,3,4,5,6,7,8,9,10, Jack, Queen, King. The objective of the game is to guess whether the next card is going to be higher or lower than the current card. Assume the casino is using one deck for High Low, so no duplicates of cards can be drawn in the same game.
Gameplay as follows:
The user makes a bet, the casino matches the amount to create the pot
If this is not the first round, the new pot is combined with the previous pot
A card is drawn and shown to the user, the user guesses if the next card will be high or low. Ties are considered high
If incorrect, the casino wins
If the user is correct, ask if they want to continue or if they want to stop.
If the user continues, repeat steps 1 through 4
If the user stops, the user wins
The winner wins the pot and adds the money to their balance
If the user won and guessed correctly at least 4 times, they win the pot and an additional 50 from the casino
Solution:
//Applicaation
/*
You can create new customers
All new customers have a new customerID assigned to them, starting with 1 for the first, 2 for the second, 3 for the third, ect.
New customers have names and monetary balances
Default values are “default customer” for name and 1000 for balance
You can add or subtract from a customer’s balance
Customer balances cannot go below 0
You can change a customer’s name
You can display a customer’s name and his or her balance
*/
/*
class Customer
{
double balance;
String customername;
Customer()
{
this.balance = 1000;
this.customername = "default customer";
}
public void createCustomer(String customername,double
balance)
{
if(balance==0)
{
this.balance = 1000;
}
else
this.balance = balance;
if(customername == "")
{
this.customername = "default customer";
}
else
this.customername = customername;
}
void addBalance(double balance)
{
this.balance += balance;
}
void subtractBalance(double balance)
{
if((this.balance == 0 ) || (this.balance - balance <= 0))
System.out.println("Customer Balance shouldn't 0 or lessthan
that");
else
this.balance -= balance;
}
public void changeCustomerName(String name)
{
this.customername = name;
}
public void showCustomer()
{
System.out.println("Customer Name : "+ customername);
System.out.println("Customer Balance : "+ balance);
}
}
*/
/*
You can create a new casino
All new casinos have a new casinoID assigned to them, starting with 1 for the first, 2 for the second, 3 for the third, ect.
New casinos have names and monetary balances
Default values are “default casino” for name and 50000 for balance
You can add or subtract from a casino’s balance
Casino balances cannot go below 0
Casinos offer 4 different games that customers can play
*/
//import java.util.*;
import java.util.Scanner;
import java.util.*;
class Casino
{
private int casinoID;
private String casinoName;
private double casinobalance;
double balance;
String customername;
Casino()
{
casinoID=0;
}
//Customer
public void createCustomer(String customername,double
balance)
{
if(balance==0)
{
this.balance = 1000;
}
else
this.balance = balance;
if(customername == "")
{
this.customername = "default customer";
}
else
this.customername = customername;
}
void addBalance(double balance)
{
this.balance += balance;
}
boolean subtractBalance(double balance)
{
boolean status =true;
if((this.balance == 0 ) || (this.balance - balance <= 0))
{
System.out.println("Customer Balance shouldn't 0 or lessthan
that");
status =false;
}
else
this.balance -= balance;
return status;
}
public void changeCustomerName(String name)
{
this.customername = name;
}
public void showCustomer()
{
System.out.println("Customer Name : "+ customername);
System.out.println("Customer Balance : "+ balance);
}
//Casino
public void createCasino(String casinoName,double
casinobalance)
{
casinoID = casinoID+1;
if(casinobalance==0)
{
this.casinobalance = 50000;
}
else
this.casinobalance = casinobalance;
if(casinoName == "")
{
this.casinoName = "default customer";
}
else
this.casinoName = casinoName;
}
void addcasinoBalance(double casinobalance)
{
this.casinobalance += casinobalance;
}
boolean subtractcasinoBalance(double casinobalance)
{
boolean status =true;
if((this.casinobalance == 0 ) || (this.casinobalance -
casinobalance <= 0))
{
System.out.println("Casino Balance shouldn't 0 or lessthan
that");
status = false;
}
else
this.casinobalance -= casinobalance;
return status;
}
public void changeCasinoName(String name)
{
if(subtractcasinoBalance(15000))
this.casinoName = name;
else
System.out.println("Insufficent funds to change casino
name");
}
void showGames()
{
System.out.println("Games List");
System.out.println("1) Twenty-one");
System.out.println("2) Slots");
System.out.println("3) High Low");
System.out.println("4) Seven-Eleven");
}
public void showCasinoDetails()
{
System.out.println("Casino ID : "+ casinoID);
System.out.println("Casino Name : "+ casinoName);
System.out.println("Casino Balance : "+ casinobalance);
}
public void playGame()
{
showGames();
System.out.println("Select Game :");
Scanner in = new Scanner(System.in);
int Option = in.nextInt();
switch(Option)
{
case 1:
System.out.println("Select Game :");
Scanner in1 = new Scanner(System.in);
int bet = in1.nextInt();
Random rand = new Random();
while(true)
{
int playerroll = rand.nextInt(11) + 1;
int casinoroll = rand.nextInt(11) + 1;
if((playerroll ==7 && casinoroll == 7) ||
(playerroll ==11 && casinoroll == 11) ||
(playerroll !=7 && casinoroll != 7) ||
(playerroll !=11 && casinoroll != 11))
{
continue;
}
if((playerroll == 7 || playerroll == 11) &&
(casinoroll !=7 && casinoroll != 11))
{
addBalance(bet);
subtractcasinoBalance(bet);
}
else if(playerroll == 7 && casinoroll == 11)
{
addcasinoBalance(bet);
subtractBalance(bet);
}
else if(playerroll ==11 && casinoroll == 7)
{
addBalance(bet);
subtractcasinoBalance(bet);
}
System.out.println("Player : "+ playerroll);
System.out.println("casino : "+ casinoroll);
break;
}
break;
case 2:
System.out.println("Number of Spins : ");
Scanner in2 = new Scanner(System.in);
int noofspins = in2.nextInt();
addcasinoBalance(noofspins*5);
if(subtractBalance(noofspins*5) == false)
{
System.out.println(" Insufficent Balance in customer... ");
break;
}
int count=0;
int[] intArray = {1,9,20,70};
while(count < noofspins)
{
int idx = new Random().nextInt(intArray.length);
int chance = intArray[idx];
int bal=0;
switch(chance)
{
case 1:
bal=1;
break;
case 9:
bal= 5;
break;
case 20:
bal= 10;
break;
case 70:
bal= 100;
break;
}
addBalance(bal);
subtractcasinoBalance(bal);
}
case 3: //sorry due lack of time i wasn't implement 3 and 4
System.out.println(" Game not supported... ");
break;
case 4:
System.out.println(" Game not supported... ");
break;
}
}
}
public class Application{
public static void main(String []args){
Casino obj=new Casino();
while (true){
System.out.println(" Casino System Application ");
System.out.println("1) Create a new customer ");
System.out.println("2) Create a new casino ");
System.out.println("3) Change a customer’s name ");
System.out.println("4) Change a casino’s name ");
System.out.println("5) Play games as a customer ");
System.out.println("6) Display customer details ");
System.out.println("7) Display casino details ");
System.out.println("Select Option : ");
Scanner in = new Scanner(System.in);
int choice = in.nextInt();
switch(choice)
{
case 1:
System.out.println("Enter Customer Name : ");
String custname= in.nextLine();
System.out.println("Enter Customer Balance : ");
double custbal = in.nextDouble();
obj.createCustomer(custname,custbal);
//obj.createCustomer("",0); // you can give user defined
break;
case 2:
System.out.println("Enter Casino Name : ");
String cname= in.nextLine();
System.out.println("Enter Casino Balance : ");
double cbal = in.nextDouble();
obj.createCasino(cname,cbal);
//obj.createCasino("",0); //default casion creation
break;
case 3:
System.out.println("Enter Customer Name : ");
String name= in.nextLine();
obj.changeCustomerName(name);
break;
case 4:
System.out.println("Enter Casion Name : ");
String name1= in.nextLine();
obj.changeCasinoName(name1);
break;
case 5:
obj.playGame();
break;
case 6:
obj.showCustomer();
break;
case 7:
obj.showCasinoDetails();
break;
case 8:
break;
}
}
}
}
You are helping a corporation create a new system for keeping track of casinos and customers....
Using Java You are helping a corporation create a new system for keeping track of casinos and customers. The system will be able to record and modify customer and casino information. It will also be able to simulate games in the casino. Customer-specific requirements You can create new customers All new customers have a new customerID assigned to them, starting with 1 for the first, 2 for the second, 3 for the third, ect. New customers have names and monetary...
Please write the program in python: 3. Design and implement a simulation of the game of volleyball. Normal volleyball is played like racquetball, in that a team can only score points when it is serving. Games are played to 15, but must be won by at least two points. 7. Craps is a dice game played at many casinos. A player rolls a pair of normal six-sided dice. If the initial roll is 2, 3, or 12, the player loses....
Using C++ Create a Blackjack program with the following features: Single player game against the dealer. Numbered cards count as the number they represent (example: 2 of any suit counts as 2) except the Aces which can count as either 1 or 11, at the discretion of the player holding the card. Face cards count as 10. Player starts with $500. Player places bet before being dealt a card in a new game. New game: Deal 2 cards to each...
Create a simplified Blackjack game using the Deck and Card classes (download the attached files to start). There is also a "TestCard" class that creates a Deck and runs some simple code. You may choose to use this file to help you get started with your game program. 1) Deal 2 cards to the "player" and 2 cards to the "dealer". Print both the player's cards, print one of the dealer's cards. Print the total value of the player's hand. 2) Ask...
the card game Acey Deucey, which is also known by several other names. In general, the game is played with three or more people that continue to gamble for a pot of money. The pot grows and shrinks depending on how much General description of the game ● Two cards are dealt face up to a player from a shuffled deck of cards. ○ If the face of each card is the same then the player adds $1 into the...
Need a blackjack code for my assignment its due in 3 hours: it has to include classes and object C++. Create a fully functioning Blackjack game in three separate phases. A text based version with no graphics, a text based object oriented version and lastly an object oriented 2D graphical version. Credits (money) is kept track of throughout the game by placing a number next to the player name. Everything shown to the user will be in plain text. No...
2 A Game of UNO You are to develop an interactive game of UNO between a number of players. The gameplay for UNO is described at https://www.unorules.com/. Your program should operate as follows. 2.1 Setup 1. UNO cards are represented as variables of the following type: typedef struct card_s { char suit[7]; int value; char action[15]; struct card_s *pt; } card; You are allowed to add attributes to this definition, but not to remove any. You can represent colors by...
"Blackjack 40" my teacher created this assignment and I need help. He is using c++ and has provided this template: Further instructions are below the template! #include <iostream> #include <cmath> #include <cstdlib> using namespace std; //Will return a number from 1 to 13, representing the face of a card int draw_card() { return rand() % 13 + 1; } int main() { const int BET = 10; //This will allow you to control chance, to make testing easier cout <<...
programming language c++
programming language c++
1:25 #WW # 53% You may, if you wish, work in pairs; this means that a submission may have 2 names attached but those 2 people must have worked on the project. No free rides! The way to submit the program to me is as follows: put the entire program (main and any other functions) into a single compile. Compile it to be sure that you have the correct set of #include statements and...
Create a Java text-based simulation that plays baccarat between two players. In baccarat, there is a banker and there is a player. Two cards are dealt to the banker and two cards to the player. Both cards in each hand are added together, and the objective (player) is to draw a two or three-card hand that totals closer to 9 than the banker. In baccarat, the card values are as follows: • 2–9 are worth face value • 10, J,...