Don't know what to do

This is a discussion on Don't know what to do within the C++ Programming forums, part of the General Programming Boards category; I really don't understand how to start this program off.Is it possible for someone to help me by giving me ...

Don't know what to do

I really don't understand how to start this program off.Is it possible for someone to help me by giving me some pseudo code?. I don't know where to start or how to start. The program is below.

Task:You are to write a program that will allow a user to play a simplified version of roulette. The sample execution given below should help demonstrate the expected behavior and the error checking required. If you lose on a turn, then you lose your bet. If you win on a turn, then for ODD/EVEN you win the equivalent amount of your bet. For a 1/3 RANGE bet (first group, second group, third group), you win 2 times your bet. When betting on a specific number, you win 35 times your bet. Also notice that the roulette wheel contains 38 equally probable numbers: 0, 00, 1, 2, ... 36. When 0 or 00 comes up, you lose ... regardless of the bet.
Rules and Requirements:
1) Start the user out with $1000. The game should loop until the user enters a 0 bet (the signal to cash out) or until the user goes bankrupt (no money left). Upon cashing out, you should print out the user's final monetary total. When a game ends, ask the user if he/she wants to play again (y/n). If the user answers yes, start another game, beginning agiain at $1000. If no, quit the program. If an invalid character is entered, print an error message and make the user re-enter their response. (You may assume the input to this question will be a single character).
2) For each spin of the wheel, first ask the user for the amount of the bet, then for what type of bet. Negative bets are illegal, as are bets larger than the amount of money you have, and there are only six valid menu choices (as shown in the sample execution). Upon an illegal entry, print an error message and prompt the user to re-enter. If the user wants to bet on a specific number, have the user input this as well (and error check the value). Valid numbers on the wheel are 1 through 36.

Note: For all of these inputs, you may assume the correct type of input. (All of the inputs described in item (2) above are integers). You only need to error check on values.

3) You will need to use random number generation to simulate the spinning of the roulette wheel. Make sure to include the appropriate libraries.

4) Your output doesn't have to match the sample execution word for word, but it must contain all of the elements that are shown in the sample run. For example, when prompting for the bet, you must print the possible range allowable for the bet (this varies based on the amount of money you have).

5) General Requirements
No global variables, other than constants!
You must use two or more useful functions in your program. (For example, if you write the entire program in a function, then write main() so that it does nothing but call that function, this does not count as useful). Between your two or more functions, you must use at least one useful parameter, and one useful return.
You may use the libraries: iostream , cstdlib, ctime. (The last two are for the random number generation).

Sample output:

Let's play some roulette!

You will start out with $1000.

What is your bet (1 - 1000, 0 to quit)? 500
What do you want to bet on?

1 - ODD
2 - EVEN
3 - First group (1-12)
4 - Second group (13-24)
5 - Third group (25-36)
6 - specific number

Enter choice (1-6): 2
The ball lands on 2.
You win $500.
You now have $1500

Use top-down design to decompose your large problem into easy to manage modules which you can code as functions. You need to prompt, input, roll the wheel, output, etc. Each one of those tasks can be a function. By thinking of a problem like this, you take a large problem and break it up into smaller problems which you can solve and code. Before you code, decide what those modules will be, what specifically they will do, what parameters they will need, and what they will return. Then, coding should be a snap
Good luck

"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.

"If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.

i'm stuck

Okay. I posted a program about roulette not to long ago. I have written some of the code but I don't know where to go from there. I know that I need two useful functions but what would I use those functions for? Would I use one for the random generator? Am I doing the program right so far? Can I put if statments in the switch? For instance, if the user chooses ODD or Even, they would win the equivalent of there bet. Where would this info go?

Once you get this working correctly, you can move on to the next piece. By creating functions, you can work on the program piece by piece, and fixing syntax and/or logic errors can be done as you code, and can be easier to narrow down. (My code has not been compiled, so there may be errors) (By the way, you should use code tags for your code, it makes it much easier to read). One suggestion, perhaps the 'choice' should be a 'char' instead of an int.

confused about random generator

This program is about roulette. Has anyone ever had to write a roullette game? If so, how did you use the rand function? The number are between 0, 00 to 38. would I use a for statement? How do you tell when the ball rolls? Do I put that info in the main function, make up a function or put it in the rand fuction? Can i have an example. It helps me better to have a visual. Here's what I've written thus far:

Task:You are to write a program that will allow a user to play a simplified version of roulette. The sample execution given below should help demonstrate the expected behavior and the error checking required. If you lose on a turn, then you lose your bet. If you win on a turn, then for ODD/EVEN you win the equivalent amount of your bet. For a 1/3 RANGE bet (first group, second group, third group), you win 2 times your bet. When betting on a specific number, you win 35 times your bet. Also notice that the roulette wheel contains 38 equally probable numbers: 0, 00, 1, 2, ... 36. When 0 or 00 comes up, you lose ... regardless of the bet.
Rules and Requirements:
1) Start the user out with $1000. The game should loop until the user enters a 0 bet (the signal to cash out) or until the user goes bankrupt (no money left). Upon cashing out, you should print out the user's final monetary total. When a game ends, ask the user if he/she wants to play again (y/n). If the user answers yes, start another game, beginning agiain at $1000. If no, quit the program. If an invalid character is entered, print an error message and make the user re-enter their response. (You may assume the input to this question will be a single character).
2) For each spin of the wheel, first ask the user for the amount of the bet, then for what type of bet. Negative bets are illegal, as are bets larger than the amount of money you have, and there are only six valid menu choices (as shown in the sample execution). Upon an illegal entry, print an error message and prompt the user to re-enter. If the user wants to bet on a specific number, have the user input this as well (and error check the value). Valid numbers on the wheel are 1 through 36.

Note: For all of these inputs, you may assume the correct type of input. (All of the inputs described in item (2) above are integers). You only need to error check on values.

3) You will need to use random number generation to simulate the spinning of the roulette wheel. Make sure to include the appropriate libraries.

4) Your output doesn't have to match the sample execution word for word, but it must contain all of the elements that are shown in the sample run. For example, when prompting for the bet, you must print the possible range allowable for the bet (this varies based on the amount of money you have).

5) General Requirements
No global variables, other than constants!
You must use two or more useful functions in your program. (For example, if you write the entire program in a function, then write main() so that it does nothing but call that function, this does not count as useful). Between your two or more functions, you must use at least one useful parameter, and one useful return.
You may use the libraries: iostream , cstdlib, ctime. (The last two are for the random number generation).

Sample output:

Let's play some roulette!

You will start out with $1000.

What is your bet (1 - 1000, 0 to quit)? 500
What do you want to bet on?

1 - ODD
2 - EVEN
3 - First group (1-12)
4 - Second group (13-24)
5 - Third group (25-36)
6 - specific number

Enter choice (1-6): 2
The ball lands on 2.
You win $500.
You now have $1500