need help..

Martha takes a jar of quarters to the casino with the intention of becoming rich, She plays 3 machines in turn. Unknown to her, the machines are entirely predictable, Each play costs one quarter. The first machine pays 30 quarters every 35th time it is played, the second machine pays 60 quarters every 100th time it is played and the third pays 9 quarters every 10th time it is played.

your program should take as input the number of quarters in Martha's jar(there will be at least one and fewer than 1000), and the number of times each machine has played since it last paid. After obtaining the input of your program should pass the following parameters to the function Martha_goes_home: the number of quarters that Martha starts with, the number of times machine1 has played since it last paid, the number of times machine2 has played since it last paid, and the number of times machine3 has played since last paid.
your program should output the number of times Martha plays until she goes broke.
Hint: use modulus division to determine whether a machine is paying out or not.

really need someone's to try this cuz i need someone else's perspective please. required for tomorrow so whoever can help it would mean a lot. thank you and good luck.
Last edited on
I got the solution for you - it's going to cost you $60 - are you willing to pay?
Both of you are the problem with some of these forums.

Yocomp, do your own work.

KunjeeB, don't tout your solutions on here. (Unless that was an elaborate set up to tell the OP to do his own work)
Last edited on
My statement was bogus - I don't even have a means of collecting money from OP.

Pitty you had to go and spoil my fun now :)
Ok - back to role play now:

"Hey iHutch105!!! - mind your own business!!!"
Thought it might have been. :-)

Original post edited.
no i won't pay, and iHutch105, if you have nothing good to say or do here, don't post at all, please and thank you.
If you just want us to do your work for you, you shouldn't bother coming here either. This forum is not a free drop-off-your-work-to-be-completed-for-you service.
if you have nothing good to say or do here, don't post at all, please and thank you.


I think this applies to you more than him.
im not asking anyone to do my work, im working on it myself, i was just asking for another perspective. im not forcing anything upon you it's only if you can and want to.
If you want help, just post your code and what isn't working and we'll help you figure it out.
currently working on different program:

//need to create multiple blocks


#include <iostream>
#include <string>

using namespace std;

bool verifyWin (char);
int showTable (int, int);
char display [5][5] = { { ' ', '|', ' ', '|', ' ' }, { '-', '+', '-', '+', '-' }, { ' ', '|', ' ', '|', ' ' }, { '-', '+', '-', '+', '-' }, { ' ', '|', ' ', '|', ' ' } };

int main (){

string game("Tic Tac Toe");
cout<<game<<endl;


char board [3][3] = { { ' ', ' ', ' ' }, { ' ', ' ', ' ' }, { ' ', ' ', ' ' } },
player[2] = { ' ', ' ' },
int try = 'y';

bool gameWon = false;

while (try != 'n')
{
int turns = 0;
cout << "Player 1 enter the character you would like to play with: ";
cin >> player[0];

while (player[0] == ' ' || player[0] == ' ')
{
cout << "Do not enter a space, enter a character: ";
cin >> player[0];
}
cout << endl << "Player 2 enter the character you are going to use (no spaces): ";
cin >> player[1];
while (player[1] == ' ' || player[1] == ' ')
{
cout << "Do not enter a space, enter a character: ";
cin >> player[1];
}

while (turns != 9 && !gameWon)
{
int x;
int y;
cout << endl << endl;
bool first = true;
bool second = true;

while (first && turns != 9)

{
first = false;

showTable(int x, int y);

cout << endl << "Player 1: Enter 2 numbers (1-3) to place your symbol: ";
cin >> x >> y;
while (x > 3 || x < 1 || y > 3 || y < 1)//user can't enter anything less or more than number 1-3
cout << "You must enter numbers from 1 to 3, enter again: ";
cin >> x >> y;
}

if (board[x - 1][y - 1] != ' ') //user has to enter in an empty space
{
first = true;
cout << "That spot is already taken." << endl ;
}

else
{
board[x - 1][y - 1] = player[0];
x = (x * 2) - 1;
y = (y * 2) - 1;
display[x - 1][y - 1] = player[0];
if (verifyWin(player[0])) gameWon = true; //call and statement,
turns++;
//places board position by substracting from each variable
}
}
}
cout << endl;
showTable(int x, int y);
if (verifyWin(player[0]))

cout << "Player 1 wins" <<endl;

else

if (verifyWin(player[1]))

cout <<"Player 2 wins" << endl;

else

cout<<"The game is a draw." << endl;

cout << "Would you like to play again? (y)?(n)?: ";
cin >> try;

if (try != 'n')

for (int x = 1; x <= 3; x++)

for (int y = 1; y <= 3; y++)


board[x - 1][y - 1] = ' ';

display[(x * 2) - 2][(y * 2) - 2] = ' ';

}




cout<<endl;


return 0;
}

What kinds of issues are you having with it?
it's just not compiling and i can't find out why :/
First of all, we have so many people trying to get us to do their work on this site, looking for quick-fix solutions rather than answers. So I tend to reserve the "good" stuff I have to say for the people I feel deserve the help.

Is your current code giving any compilation errors? If so, what are they? It makes finding the root of the problem a lot easier.
Can someone please explain to me how we got from Martha to Tic_tac-Toe???
@Yocomp: here's the fixed code, all you have to do now is:
1. READ THE C++ TUTORIAL!!! http://www.cplusplus.com/doc/tutorial/
2. declare the functions showtable() and verifywin()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#include <iostream>
#include <string>

using namespace std;

bool verifyWin (char);
int showTable (int, int);
char display [5][5] = { { ' ', '|', ' ', '|', ' ' }, { '-', '+', '-', '+', '-' }, { ' ', '|', ' ', '|', ' ' }, { '-', '+', '-', '+', '-' }, { ' ', '|', ' ', '|', ' ' } };
int x, y;
int main (){

string game("Tic Tac Toe");
cout<<game<<endl;


char board [3][3] = { { ' ', ' ', ' ' }, { ' ', ' ', ' ' }, { ' ', ' ', ' ' } },
player[2] = { ' ', ' ' };
int t = 'y';

bool gameWon = false;

while (t != 'n')
{
int turns = 0;
cout << "Player 1 enter the character you would like to play with: ";
cin >> player[0];

while (player[0] == ' ' || player[0] == ' ')
{
cout << "Do not enter a space, enter a character: ";
cin >> player[0];
}
cout << endl << "Player 2 enter the character you are going to use (no spaces): ";
cin >> player[1];
while (player[1] == ' ' || player[1] == ' ')
{
cout << "Do not enter a space, enter a character: ";
cin >> player[1];
}

while (turns != 9 && !gameWon)
{
cout << endl << endl;
bool first = true;
bool second = true;

while (first && turns != 9)

{
first = false;

showTable(x, y);

cout << endl << "Player 1: Enter 2 numbers (1-3) to place your symbol: ";
cin >> x >> y;
while (x > 3 || x < 1 || y > 3 || y < 1)//user can't enter anything less or more than number 1-3
cout << "You must enter numbers from 1 to 3, enter again: ";
cin >> x >> y;
}

if (board[x - 1][y - 1] != ' ') //user has to enter in an empty space
{
first = true;
cout << "That spot is already taken." << endl ;
}

else
{
board[x - 1][y - 1] = player[0];
x = (x * 2) - 1;
y = (y * 2) - 1;
display[x - 1][y - 1] = player[0];
if (verifyWin(player[0])) gameWon = true; //call and statement,
turns++;
//places board position by substracting from each variable
}
}
}
cout << endl;
showTable(x, y);
if (verifyWin(player[0]))

cout << "Player 1 wins" <<endl;

else

if (verifyWin(player[1]))

cout <<"Player 2 wins" << endl;

else
{
cout<<"The game is a draw." << endl;

cout << "Would you like to play again? (y)?(n)?: ";
cin >> t;

if (t != 'n')

for (int x = 1; x <= 3; x++)

for (int y = 1; y <= 3; y++)


board[x - 1][y - 1] = ' ';

display[(x * 2) - 2][(y * 2) - 2] = ' ';

}




cout<<endl;


return 0;
}
Topic archived. No new replies allowed.