Create the variables and methods needed for this class The B
Create the variables, and methods needed for this class:
The Bank class represents the Bank in a Craps game. The Bank takes the players bets. The Bank is a data class. The only information we need to manage (the field or class variable) is how much money we need to payout to the winner. If the winner bets $10, then the bank matches that for $20. The winner gets the $20.
Methods are needed to manage this data.
Solution
#include<bits/stdc++.h>
using namespace std;
class Bank
{
double payout;
public:
double getTotal()
{
return payout;
}
bool placeBet(double bet)
{
if(bet>0)
{
payout+=bet*2;
return true;
}
return false;
}
double payout()
{
int p=payout;
payout=0;
return p;
}
};
=============================================================
Comment about the work
