Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are helping a corporation create a new system for keeping track of casinos a

ID: 3713499 • Letter: Y

Question

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

1. You can create new customers a. 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. b. New customers have names and monetary balances c. Default values are “default customer” for name and 1000 for balance 2. You can add or subtract from a customer’s balance a. Customer balances cannot go below 0 3. You can change a customer’s name 4. You can display a customer’s name and his or her balance Casino-specific requirements 1. You can create a new casino a. 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. b. New casinos have names and monetary balances c. Default values are “default casino” for name and 50000 for balance 2. You can add or subtract from a casino’s balance a. Casino balances cannot go below 0 3. Casinos offer 4 different games that customers can play a. Twenty-one b. High Low c. Seven-Eleven d. Slots 4. You can change a casino’s name a. Changing a casino’s name subtracts the casino’s balance by 15000 5. 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. 1) Any bets placed by the user and casino are deducted from the respective balances of both parties 2) Lost bets are added to the casino balance. 3) Amounts lost by the casino are deducted from the casino balance and added to the customer’s balance. 4) If a bet would cause either a casino or customer balance to go negative, that bet cannot be placed. 5) 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: 1. The user makes a bet, the casino matches the amount to create the pot 2. The user and the casino each roll 2 six-sided dice simultaneously. The sum of both die is that player's total a. If a player rolls a 7 or 11 and the other does not, the player with the 7 or 11 wins b. If neither player rolls a 7 or 11, roll again c. If both players roll a 7 or if both players roll an 11, roll again d. If one player rolls a 7 and the other rolls an 11, the one who rolled an 11 wins 3. 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: 1. The user makes a bet, the casino matches the amount to create the pot 2. 2 cards are dealt to the player, 2 cards are dealt to the dealer a. The user can see both of their cards and one of the dealer’s cards 3. The user can choose to either draw a new card or stay with their current hand 4. If a user chooses to draw and their hand total exceeds 21, the casino wins 5. Once the user chooses to stay, the dealer will either draw a new card or stay a. If the dealer’s hand is 17 or higher, they stay. If it is lower than 17, they draw 6. If the dealer draws and their hand total exceeds 21, the user wins 7. If both the dealer and the user stay, the totals are compared and the higher total wins a. In case of a tie, the customer receives the initial bet back 8. The winner wins the pot and adds the money to their balance Slots Gameplay as follows: 1. The user is asked for the number of spins 2. Every spin costs the customer 5, this is added to the casino balance 3. Each spin, one of the following outcomes occurs: a. 70% chance to win 1 from the casino b. 20% chance to win 5 from the casino c. 9% chance to win 10 from the casino d. 1% chance to win 100 from the casino 4. Display the amount the user won 5. 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: 1. The user makes a bet, the casino matches the amount to create the pot a. If this is not the first round, the new pot is combined with the previous pot 2. 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 3. If incorrect, the casino wins 4. If the user is correct, ask if they want to continue or if they want to stop. 5. If the user continues, repeat steps 1 through 4 6. If the user stops, the user wins 7. The winner wins the pot and adds the money to their balance a. If the user won and guessed correctly at least 4 times, they win the pot and an additional 50 from the casino Program requirements In your main method, create a menu that a user can navigate through. Create the options to complete the following tasks: 1. Create a new customer 2. Create a new casino 3. Change a customer’s name 4. Change a casino’s name 5. Play games as a customer 6. Display customer details 7. Display casino details Project Checklist Submissions should include the following: 1. Project .java files 2. 2 Flowcharts 3. UML Diagram 4. Test cases 5. Group feedback Groups will designate one team member to submit all project files. All group members will submit group feedback as part of their grade. Individuals do not need to submit group feedback .java Files Initialize your program with 3 customers and 3 casinos. Set different names and money amounts for each. Your program should be clearly labeled throughout with pseudo-code. Comments are not only a component of your grade, but will also give me a better understanding of your program if it crashes at any point. Flowchart and UML Diagrams Create 2 flowcharts representing the flows of any 2 of the games. The UML diagram should represent the entire program and clearly indicate classes, class variables, and methods Test Cases Create screenshots that demonstrate the following requirements: 1) Creating a new customer 2) Creating a new casino 3) Changing a customer name 4) Changing a casino name 5) 1 game of twenty-one where the customer wins 6) 1 game of twenty-one where the casino wins 7) 1 game of high low where the customer wins (any amount) 8) 1 game of high low where the customer loses 9) 1 game of seven eleven where the customer wins 10) 1 game of seven eleven where the customer loses 11) 1 game of slots with 5 spins Display the name and bankroll of the customer and the casino interacting before and after games for cases 5 through 11. Label all screenshots and organize them into a word document.

Explanation / Answer

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;
}
  
}
  
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote