(D-Problems discussed on Wednesday, 23-Jan-2013)
(Q-Problems due on Friday, 25-Jan-2013)
(IMPORTANT NOTE for all Scratch Programs: What is given in the homework writeup is merely the minimum requirement. You are encouraged to use your creativity and imagination to make your Scratch program do MORE than the minimum requirement and, more importantly, to make it FUN.)
Practice Problems: (not graded)
I have included a number of practice problems for you to try out.
These problems will help you to "ease into" the materials
covered in the course. (If you have difficulties with these
practice problems, please quickly see your classmates
or the instructor for help.)
T2-PP1: [Your first Scratch program]
After downloading Scratch (See T1), write your first Scratch program
that will make the cat (the default sprite/actor) "move around,
change customs, and say Meow" a few times.
T2-PP2: [Doing-something-many-times in Scratch program]
After you had fun with your first Scratch program, now is time
of get more serious. Instead of just randomly moving around, how
about getting the cat to "do something many times", such as doing the
following 8 times:
(move forward 10 steps; change costume, say "Meow" for 0.5s;)
(Note: You can add the "same commands" 8 times,
but there is a simpler way. Find it and use it!)
(If you can't find it, check out T2-D1 first.)
Discussion Problems: -- Prepare (individually)
for tutorial discussion.
T2-D0: Read [SG] Ch. 1 & 2
T2-D1: [Having fun with Scratch]
After you have downloaded Scratch, you can now download the
following simple Scratch programs:
(a) forward-backward.sb --
(Learn how each command works.)
sum-1-to-5-no-loop.sb --
(This Scratch program computes the sum of 1+2+3+4+5.
It does it the straightforward way, without using loops!
This works, but is not scalable for large sums such as
(1+2+3+. . . + 99 + 1000).
sum-1-to-5-loop.sb --
(This Scratch program computes the sum of 1+2+3+4+5.
It does it with a loop, like the algorithm in the lecture notes.
This works and is scalable for large sums such as
(1+2+3+. . . + 99 + 1000).
sum.sb --
(The Scratch program computes sum of 1..100 and is more concise.)
Examine these Scratch programs carefully to see how they work.
Make small changes (by modifying the Scratch blocks)
and see what happens (you should save as your own versions).
You can also play around with the other Scratch blocks to see what
they do. Try combining some of the blocks.
Also, try right-clicking the different "objects" to see what other functionalities are available.
Try them out to see how they work.
T2-D2: (Algorithm: Step by Step Instruction)
Write out an informal algorithm for going from the Dean's Office of your
home faculty to the UIT2201 lecture venue at ERC-SR1.
[Note:
Your algorithm should be given in the same format as that the algorithm
for "sum of 1 to 100" in lecture notes or like that in Figure 1.1 of [SG3].
You may need to carefully "define" your own "primitive operations".]
T2-D3: (Computing Device)
Consider one computing system that you encounter in
your everyday life and that has not been
discussed in the lectures (preferably one related to your own discipline).
Discuss how it might have been designed and note the
similarities and
difference with other examples we considered in class.
T2-D4: (All kinds of graphs or networks)
Graph model (also called networks) are used in many different discipline
to model all kinds of things. Do a search and
find a problem (not from CS-IT-Engg field)
that has been modeled and solved as a graph problem.
(Does not have to be graph coloring problem, of course.)
Problems to be Handed in for Grading by the Deadline:
(Note: Please submit hard copy to me.
Not just soft copy via email.)
T2-Q1: (15 points) (Cat moving...)
Write a Scratch program that makes the cat do the following:
(IMPORTANT: You WILL LOSE MARKS if your Scratch program do not conform to the standard naming convention.)
(Note: Remember the remark above about minimum requirements and about enhancing your Scratch program with creativity and imagination!.)
T2-Q2: (5 points) (Algorithm Even-Odd-101-to-2013)
In the lecture notes, algorithm Sum-1-to-100
finds the sum of all the integers from 1 to 100, namely,
1 + 2 + 3 + ... + 99 + 100.
Modify this algorithm very slightly to get
Algorithm Even-Odd-101-to-2013
that finds the sum of all the odd numbers from 101 to 2013, namely,
101 + 103 + 105 + ... + 2011 + 2013.
(Note: Please make only small changes to the original algorithm.)
T1-Q3: (10 points)
[Pervasiveness of Computing Devices in Everyday Life]
(a) Over the next two days, keep track of your activities
(say, in 2-3 hour blocks) and record any computing devices
that was used in any aspect of the activity.
(Do not forget such devices as microwaves and bus card validators.)
[Include a one-page attachment of a summary of this log.]
(b)
Discuss if and how computing devices have helped make your life more
"easy" or "difficult". Please be specific about "easy" and "difficult".
(Note: Be concise and precise -- I am expecting 2-3 pages total (including the 1-page log). .)
A2: [Black and White Colouring]
Give an algorithm that will determine if a given graph
can be coloured with two colours, black and white,
and, if so, give such a black-and-white colouring.