Assignment
Assignment
Assignment
Question 1: Scratch Project (60 points)
You are to head to http://scratch.mit.edu/ and create an account. Start by exploring some projects,
and click on the see inside button in order to understand the logic behind each project. Feel free to
make any changes to the scripts to see how it a↵ects the overall behaviour of the program. Once you
can honestly say to yourself, “Okay, I think I get this,” you are ready to proceed.
Now it is time to choose your own adventure! Your mission is, quite simply, to have fun with Scratch
and implement a project of your choice (be it an animation, a game, interactive art, or anything else),
subject only to the following requirements.
• Your project must have at least two sprites, at least one of which must resemble something other
than a cat.
• Your project must have at least three scripts total (i.e., not necessarily three per sprite).
• Your project must use at least one condition, one loop, and one variable.
• Your project must use at least one sound.
• Your project should be more complex than most of those demonstrated in lecture (many of which,
though instructive, were quite short) but it can be less complex than, say, Scratch Scratch Revolu-
tion. As such, your project should probably use a few dozen puzzle pieces overall.
1
Feel free to peruse additional projects online for inspiration, but your own project should not be terribly
similar to any of them. Try to think of an idea on your own, and then set out to implement it. But
do not try to implement the entirety of your project all at once: pluck o↵ one piece at a time. It is
important to take your time and break overall task into sub and simpler tasks.
If, along the way, you find it too difficult to implement some feature, try not to fret; alter your design
or work around the problem. If you set out to implement an idea that you find fun, you should not find
it hard to satisfy this assignment requirements.
Once finished with your project, click See project page in Scratch’s top-right corner. Ensure your
project has a title (in Scratch’s top-left corner), some detailed instructions (in Scratch’s top-right corner),
and some notes and/or credits (in Scratch’s bottom-right corner). Then click Share in Scratch’s top-
right corner so that others like your TA can see your project. Finally, take note of the URL in your
browser’s address bar. That’s your project’s URL on MIT’s website, and you will need to send it to us
in the Question1.txt file you will create.
Oh, and if you would like to exhibit your project in Fall 2014’s gallery, head to http://scratch.mit.
edu/studios/517481/projects/, then click Add projects, and paste in your own project’s URL.
Moreover, if you would like to participate to the Fall 2014 Scratch contest, where you get to vote as well
as participating, please submit that same URL to the course’s subreddit, http://www.reddit.com/r/
comp202/. The three most upvoted1 projects will be given McGill goodies, e.g. t-shirt, key-chain, pen,
bag, etc. The grand winner will also receive an additional prize.
Question 2: Simple Java Program (20 points)
You are to write your very first marked Java piece of code. The program is simply to ask the user their
name. This is achievable using the Scanner object as seen in class. You will have to save the String
input into a variable in order to output back the answer.
Your program should output the following:
Hal: How many laws of robotics are they according to Isaac Asimov?
2 < ----- Input by the user
Hal: Indeed they are 2 laws of robotics.
In order to produce this output you will need at least three instructions. One instruction to print the
sentence to ask for a number, although it could be a letter. One instruction to save that information in a
String variable. One instruction to print the sentence Hal: Indeed they are **String variable**
laws of robotics.
BONUS (5 points) - Use an if statement that will check if the number of laws is three. In the case
it is true you should output the following “Hal: You got it right. Three indeed.”. You should use the
method String.equals(String). In the case the user did not entered the right number, you have to
mentioned it and then recite the three laws of robotics, which you will have to find.
Question 3: Binary and Logic (20 points)
Please write your answer in the Question3.txt file. Each line is an answer to a question, if you do not
know the answer leave that line blank. In other words, the first line refers to line 1 of the text file, line
2 refers to the question 2, and so on. Each question is 5 points each.
a. What is 28 in binary2 ?
b. What is 11010 in base 103 ?
c. What does the following logical expression evaluate to?
(False or False) and (True and (not False))
1 Downvotes will not count
2 Where 28 is a base ten number
3 Where 11010 is a base two number
Page 2
d. Let a and b be boolean variables. Is it possible to set values for a and b to have the following
expression evaluate as False?
a or (((not b) or (not b)) or (b or (not a)))
What To Submit
You have to submit one zip file with all your files in it to MyCourses under Assignment 1. If you do not
know how to zip files, please ask any search engine or friends. Google might be your best friend with this,
and a lot of di↵erent little problems as well.
Question1.txt - Scratch URL
Question2.java - The complete java code to run the code
Question3.txt - One line for each answer
Confession.txt (optional) In this file, you can tell the TA about any issues you ran into doing
this assignment. If you point out an error that you know occurs in your problem, it may lead
the TA to give you more partial credit. On the other hand, it also may lead the TA to notice
something that otherwise he or she would not.
Marking Scheme
Up to 30% of question 2 points can be removed from bad indentation of your code as well as omitting
comments, or missing files. Marks will be removed as well if the class names are not respected.
Question 1
Two sprites 10 points
Three distinct scripts 10 points
The project runs 10 points
The project is well explained and titled 10 points
Has a least one if, loop and one variable 20 points
60 points
Question 2
Get the input of the user 10 points
Some comments and right indentation 5 points
Displays the right dialogue 5 points
Use if-else to check if “3” is entered 5 bonus points
20 points
Question 3
a. 5 points
b. 5 points
c. 5 points
d. 5 points
20 points
Page 3