Package customer
Class CustomerBet
java.lang.Object
customer.CustomerBet
Represents a customer's individual bet, including the bet details, stake amount, choice, and potential payout.
Each CustomerBet instance encapsulates a specific Bet, the amount staked by the customer,
the customer's choice for the bet, and an adjustable payout amount.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BetTheBetobject representing the details of the bet.private final charThe choice made by the customer for this bet.private doubleThe payout amount for this bet, which is adjusted based on the outcome of the bet.private final intThe amount of money staked by the customer for this bet. -
Constructor Summary
ConstructorsConstructorDescriptionCustomerBet(Bet bet, int stake, char choice) Constructs a newCustomerBetwith specified details of the bet, stake, and choice. -
Method Summary
Modifier and TypeMethodDescriptiongetBet()Retrieves the bet details associated with this customer bet.charReturns the choice made by the customer for this bet.intgetStake()Returns the amount of money staked on this bet.voidsetPayout(double payout) Sets the payout amount for this bet based on its outcome.
-
Field Details
-
bet
-
stake
private final int stakeThe amount of money staked by the customer for this bet. -
choice
private final char choiceThe choice made by the customer for this bet. -
payout
private double payoutThe payout amount for this bet, which is adjusted based on the outcome of the bet.
-
-
Constructor Details
-
CustomerBet
Constructs a newCustomerBetwith specified details of the bet, stake, and choice.- Parameters:
bet- TheBetobject representing the details of the bet.stake- The amount staked by the customer for this bet.choice- The choice made by the customer for this bet (represented as a character).
-
-
Method Details
-
getBet
-
getStake
public int getStake()Returns the amount of money staked on this bet.- Returns:
- The amount of the stake placed by the customer.
-
getChoice
public char getChoice()Returns the choice made by the customer for this bet.- Returns:
- The customer's choice as a character.
-
setPayout
public void setPayout(double payout) Sets the payout amount for this bet based on its outcome.- Parameters:
payout- The calculated payout amount for this bet.
-