The moment you read the word 'randomly' in a question, you should immediately start thinking about random number generation which I can see that you did according to the steps you have been able to figure out yourself, so good job. Here is a helpful habit you should develop as you progress as a software developer. Instead of displaying images, the program will randomly select a word As long as the value inputted by the user is not greater than the total amount of cash the user currently has, the bet is legal, otherwise, ask for another bet. Make a variable called bet and have the user enter an integer value in it. "Asks the user to enter the amount of money he or she wants to enter into the slot machine as a bet. It is actually very simple, look they have also given you the steps for implementation. make switch with different words (cherriers, oranges plums, bells, melons, bars) generate six random numbers between 1-6ģ. I just am not understanding how to make this all fit together, but I do have what I need to make the program.Ģ. I've been trying to figure this out for a week now, and now it's due today. If not, the program displays the total amount of money entered into the slot machine and the total amount won.Ĭan someone help me break down how to do this problem, but the C++ version with modules that pass values that are used in other modules? The program will ask whether the user wants to play again. If three of the words match, the program will inform the user that he or she has won three times the amount entered. If two of the randomly selected words match, the program will inform the user that he or she has won two times the amount entered. The program should randomly select a word from this list three times and display all three of the words. If the number is 0 the selected word is cherries: if the numbers is 1, the selected word is Oranges and so forth. To select a word, the program will generate a random number in the range of 0 through 5. Use an array to store this list of images Instead of displaying images, the program will randomly select a word from the following list:Ĭherries, Oranges, Plums, Bells, Melons, Bars When the program runs, it should do the following:Īsks the user to enter the amount of money he or she wants to enter into the slot machine as a bet. If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user.Ĭreate a program that simulates a slot machine. The slot machine then displays a set of random images. A slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |