What instructions would you need to give the Little Person Computer to subtract the number 125 from the number 400?
Step #
Instruction
The way the little person should function
1.
GET
Gets the first number(125) and places it in the calculator
2.
STORE 72
Stores the number input first into Mailbox numbered 72
3.
GET
Gets the second number from which the first number is to be subtracted, from inbox and places it in the calculator
4.
SUB 72
Subtracts the first number from the second-- 400-125=275
5.
PUT
Prints the result that is, 275 on a piece of paper and puts it in the out box.
6.
STOP
Stops and Rests
Which number must you enter first to make your program work properly?
Please refer the grid below.
Number entered First
Number entered Second
Reason
125
400
By standard definition of the SUB instruction, the SUB instruction subtracts the number written on the paper(In this case 125) in one of the mailboxes(in this case mailbox 72) from the number currently in the calculator(In this case which is 400)
Assignment # 2 September, 11, 2013
Assignment Question:
Now that you are an expert computer programmer, this second software assignment is simply to write down the instructions for making a peanut butter and jelly sandwich. (Note: the word limit does not apply to this assignment.)
I have made some critical assumptions such that the steps for the preparation of peanut butter have no ambiguity. Following are the assumptions:
Assumptions:
Any type of bread, peanut butter or jelly can be used.
The breads available are sliced.
There are at least 2 bread slices.
The user by following the instructions will be able to make the Peanut butter and jelly sandwich in one try.