File: hw3.txt Due date: Before 11:59pm Tuesday January 22 Grading: 20 Points total. To do: Answer the following questions. (1) What is your name? (2) Did you work with anyone else on this hw? Note - this includes /anyone/ other than Jeff (e.g., your cousin, the GA in the tutoring lab, a classmate, ...). List anyone who you talked to about it, or worked together. (3) Assembly language. The adding.151asm file addes up the numbers from 1 to 22. I will describe it either on the HW3 video or in class. Make a copy of that file into your home directory on CS, and call it hw3_add.151asm. Make changes to it so that it adds up the multiples of 7 between 7 and 777. The final result should be printed. Just so you, know the correct answer is 43512. (4) Scratch. Create your own Scratch program. Start from an empty project. You can look at the built-in Scratch programs for ideas on how to do things, but you need to start your own program from scratch (ha ha). You can make the program do anything you want, but it must meet the following requirements. a) Work with someone else from this class on the program. You should make arrangements during class on Thursday on meeting up outside of class to work on the program. b) The program must include at least one loop (those are in the Control section). The ones that are loops are: forever, repeat, forever if, repeat until, wait until. c) The program must use at least one conditional (those are in the Control section also). The ones that are conditionals are: if, if/else, wait until, repeat until, forever if. Scratch saves its files with a file extension .sb. It will add the file extension automatically (at least on Windows it does). Name your scratch file hw3_scratch.sb, and use FileZilla to put it in your home directory on CS. (4) Write here who you worked with on the Scratch program, and describe in a few sentences how it was. In particular, how much work did each person do, and were there any problems. (5) Hello to Jeff. Come by my office sometime before my office hours are done on Wednesday. You can just stop in to say hello, or you can bring some questions about the homework and the class. Plan on spending at least a few minutes chatting or talking about the class. The point of this is to ensure you are comfortable coming to ask for help when you need it. And it will help me to know everyone easier. Extra Credit, at most 3 points extra (6) Assembly, testing for primes ... a) Make an assembly program to test if one number is a factor of another number. Save the file as hw3_mod.151asm. Make it so the program determines whether 13 is a factor of 2567. The correct answer is no. You can have the program print out 0 if it is a factor, and print out any other number if it is not a factor. Here are some examples... 2 is a factor of 12. 2 is not a factor of 5. 12 is a factor of 36. 12 is not a factor of 18. My suggestion is to think of the problem as follows... You want to compute the remainder when 2567 is divided by 13. If the remainder is 0, then 13 is a factor. Otherwise, it is not. So you can just compute the remainder and output that. To compute the remainder, you'll need to know that when the assembler does division it actually does "integer division". That means it divides and rounds down. So 12 / 3 = 4. But 12 / 5 = 2. b) If you get part a) correct, you can use that to make a program that tests if a number is prime or not. A prime number is one that only has itself as a factor. So, some primes are 3, 5, 7, 11. Some numbers that are not prime are 4, 6, 8, 10, 12, 15, 21. For this part, make a program called hw3_prime.151asm that tests if the number 2341 is prime or not. The answer is that it is. Your program should work correctly to test if other numbers are prime just by changing 2341 to something else in your program code. Here is how I would think about this. You want to test if any number between 2 and 2340 is a factor of 2341. If any are, it is not prime. If none are, it is prime. If you got part a) right, then you can test if any particular number is a factor of 2341. Now you want to "make" a loop to try all numbers between 2 and 2340 as factors. The program should output 1 if the number is prime and should output 0 if it is not prime.