1. Draw a diagram like the ones in the text for if and while that shows how to implement a for loop in TOY.
2. Write a program chop.toy that reads in an integer n from standard input and punches out powers of 2 that sum to n. For example if n is 012A, then the program should punch
on the output tape since 012A = 0002 + 0008 + 0020 + 0100.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here