Machine Language Problems:
You will make a folder with your name on it. As you complete each of the following HYPO programs save them to this folder. Try to complete as many as you can before the period is over. Before the end of the period, copy the folder to the dropoff folder as you would with any assignment. You might not have enough time to complete all the programs. As long as you make a conscientious effort to finish as many as possible you can still get full marks for the assignment.
- Write a HYPO program that will store three numbers in locations 999, 998 and 997. Add them together and print the result.
- Write a HYPO program that will store three numbers in locations 999, 998 and 997. Find and print the largest number.
- Write a HYPO program that will calculate powers. Store the base in location 999 and the exponent in location 998 and print what baseexponent is. Example: if base is 5 and exponent is 3 then your program should compute 53 and print 125.
- Write a HYPO program that will calculate factorials (because the HYPOthetical computer can only work with int values you only have to do up to 12!). Find and print the factorial of the number stored in location 999.
Assume the number will be between 1 and 12 inclusive.
The formula for factorial is n! = n(n-1)(n-2)...(3)(2)(1)
Example: 5! = 5(4)(3)(2)(1) = 120