Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In x 8 6 assembly language, Write a program that asks the user to guess the next color that the wheel pointer lands on after
In x assembly language, Write a program that asks the user to guess the next color that the wheel pointer lands on after spinning. Each guess costs $ If they guess correctly, they get $ The player will start out with a $ bank. Each time he or she guesses incorrectly you will subtract $ from their bank. Each time they guess correct, you add $ to their bank. Print the bank total at the end of the game. You can simulate the spin of the wheel using the RandomRange function Dont forget to Randomize It is important that you seed the random number generator only once at the top of the file. Seeding the random number generator in a loop does not have the effect that you might think it does.
Hint: To be simple, assign numbers to colors. For example, assign to black and to red. For this game the random number generator needs to output just two numbers, or
Requirement: After the spin, you have to display the color the wheel landed on black or red. Do not display or
Your program should look something like this:
Welcome to the Spinning the Wheel game. it costs $ to play.
If you are correct, I will pay you $ If you loose, you will pay me $
Would you like to continue? yn
y
I took $ from your bank.
Please enter your guess for the next spin. Enter for black or for red.
If you are correct, I will pay you $ If you loose, you will pay me $
Winner! The color is red.
Your bank is now $
Would you like to continue? yn
y
I took $ from your bank.
Please enter your guess for the next spin. Enter for black or for red.
If you are correct, I will pay you $ If you loose, you will pay me $
Sorry you lose. The color is red.
Your bank is now $
Would you like to continue? yn
y
I took $ from your bank.
Please enter your guess for the next spin. Enter for black or for red.
If you are correct, I will pay you $ If you loose, you will pay me $
Sorry you lose. The color is black.
Your bank is now $
Would you like to continue? yn
n
Thanks for Playing
Your bank is now $
Press any key to close this window
You are to rewrite this program using higherlevel language constructs in this assignment.
Highlevel language constructs
For this assignment, you are to use one WHILE loop and highlevel decision statements IF and ELSE. Your main game loop MUST use a WHILE statement. A WHILE statement is not a REPEAT UNTIL. For this assignment REPEATUNTIL loops are not to be used and will result in a reduction of your score.
Priming the WHILE loop
You are required to prime your while loop correctly. The use of things like
WHILE true
WHILE
are not allowed and will result in a reduction in your score.
In addition, making up a value to satisfy the loop condition is not how you prime a loop properly.
Not priming the loop properly will result in a reduction in your score.
Other things you are not to do
In this assignment, you should not have any jmp or jcond statements. You are using highlevel language constructs, and if used properly, there is no need for any kind of jump in your code.
You should only have one exit statement in your code at the bottom of your program. Using an exit statement to get out of a loop will result in a reduction in your score.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started