Question: PROGRAM 6 : Crazy 8 s Game Write a program that reads a set of three different numbers. Then by subtracting off tens, determine if
PROGRAM : Crazy s Game
Write a program that reads a set of three different numbers. Then by subtracting off tens, determine if any of the values ends in an eight. Continue looping as long as one of the numbers in the set ends in eight. Three sets with a value ending in eight wins the game!
Shown below are sample program dialogues to help you build your program.
Gimme a number:
Gimme a number:
Gimme a number:
Sorry Charlie! You lose the game!
Gimme a number:
Gimme a number:
Gimme a number:
One of them ends in eight!
Gimme a number:
Gimme a number:
Gimma a number:
One of them ends in eight!
Gimme a number:
Gimme a number:
Gimme a number:
One of them ends in eight!
You Win The Game!
Gimme a number:
Gimme a number:
Gimme a number:
Sorry Charlie! You lose The Game!
Hint: This program is pretty complex with many different conditions to keep track of I would recommend you write it first in C or Visual Basic and then translate your lines of code, onebyone, into a assembly statements, just like our good friend mr compiler does
Hint: Since we don't really know how to do much math in Assembly yet, I am assuming you will loop down by subtracting ten to try to reach the value eight. If you hit exactly eight after taking off enough values of ten, you know you had an original value ending in eight. If you get to less than eight, you know the number did not end in eight.
Use the reference in the images.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
