Vous êtes sur la page 1sur 2

QRE105: Creative Computing

Assignment 5
Information

There are 4 questions and 2 remarks in this assignment (the remarks are not problems, just
statements you need to pay attention to). The assignment is for a total of 30 points. Points for
each question are indicated at the beginning.
You have the option of attempting either question 3 or 4. If you submit files for both
questions, you will get the higher of the two scores. In other words, there is no harm in trying
to attempt both questions.
Assignment is due by 11:59 p.m. on Thursday, September 8, 2016. However, it is advisable
that you try to finish this assignment by Friday, September 2 and focus on your project next
week.
You need to Export Blocks for questions 1, 2 and 4a instead of Export Project.
Assignment should be submitted on Moodle. You will need to submit 3-5 files (5 if you choose
to attempt all four questions). Follow naming instructions for each question.

Remarks
Remark 1 (Reminder): It is time to start thinking of your first project. Options include developing a
game, making a rich/interesting narrative (story), exploring advanced topics not taught in class (e.g.
nested sprites), and writing programs to make intricate geometric objects such as fractals. Note that
the first project contributes 15% to your assessment. The scale of your project should be
commensurate with this weightage. Also remember that 5% of your final grade is determined by the
documentation of your project on your website (web portfolio). You will be able to work on your
project in class during the week of September 5-10.
Remark 2: Your web portfolio contributes 20% to your overall grade. This 20% is divides as follows: 5%
each for documenting the three projects that are part of the course and 5% for general posts about
computing. The general posts can be reflections about the course (for example, about certain
assignment problems or topics). They can also be about issues or events outside the course as long as
they are related to the broad theme of the course (creative computing). The expectation is that you
will write at least 5 posts other than the ones related to the projects. A post should be at least 200
words, but you can include images and other artwork (these images must be original or be sourced
from a location that allows reuse of digital content).
Questions
1. [6 points] Write a custom block (a predicate block) that takes a string in the date format
dd/mm/yyyy as input and outputs true if the string is a valid date in 2016 and false otherwise.
Here dd stands for a number which is a date, mm stands for a number which is a month and
yyyy stands for a number which is a year). For example, the block should return true for
27/02/2016 and false for 30/02/2016 and 25/1/2017.

Submit an xml file containing this block (use the Export Blocks option to create this) with the
name problem1.xml

2. [9 points] Write a custom block (a reporter block) that takes three inputs: , , and
and produces a list (this list should be the output) of equally spaced numbers in ascending
order with the first one being , the last one being and the total length of the list
being . Your block should output an error message if > or if is not a positive
integer. For example, if = 2.5, = 4.9 and = 4, the block should output the list
2.5, 3.3, 4.1, 4.9. You can see that the output is in ascending order and of length 4, begins with
and ends with . The list items are equally spaced since the difference between any
consecutive items is the same (0.8).
Submit an xml file containing this block (use the Export Blocks option to create this) with the
name problem2.xml

3. [15 points] Write a SNAP! script that asks the user for a date in the dd/mm/yyyy format (see
Problem 1), verifies that it is a valid date in 2016 and outputs the day of the week
corresponding to that date. For example, if the user inputs 1/09/2016, the output should be
Thursday. You should write a script, not a custom block. The user should be able to input many
dates one at a time.
Submit an xml file (use the Export Project option to create this) with the name problem3.xml

4. [9 points for part a, 6 points for part b]


a. Write a custom block (a reporter block) that takes in a string input (lets call it
_) and outputs the reverse of the string. For example, if the input is
Sriram, the output should be marirS.
b. Write a SNAP! script that keeps asking the user to enter some text and determines
whether the input is a palindrome or not. A palindrome is a piece of text that reads
the same both forwards and backwards. For example, malayalam is a palindrome,
but tamil is not.
For part a, submit an xml file containing the block (use the Export Blocks option to create
this) with the name problem4a.xml . For part b, submit an xml file (use the Export Project
option to create this) with the name problem4b.xml

Vous aimerez peut-être aussi