Placement Test
10 Registration
The placement test started on July 3. But, you can register late by emailing d.patterson AT northeastern.edu.
11 Dates
The placement test will run from July 3 – August 11. It will not require 1.5 months of work. But, it will require studying portions of a textbook and working through several exercises by yourself. The 1.5 months duration is to give you flexibility. You will be able to complete the test at any point while the test is out.
12 Questions
What should I do to prepare before July 3? I recommend nothing. If you really want to, you can start the Required Reading
What will be the format of the placement test? The test will have programming problems (similar to those in the book) and math problems (similar to problems from high school algebra). The test will not have a time limit. You will be able to use DrRacket and the book as a reference. Do not search the web for answers. You will find them and “do well” on the test, but will have a rough time in the accelerated course. The placement test does not count towards your grade, so cheating in this way will only hurt you.
Feel free to email me at d.patterson AT northeastern.edu if you have any questions.
13 Required Software
The placement test, and the rest of Accelerated 1, takes place within Racket (a collection of languages and an IDE), which you can download from the Racket website:
14 Required Reading
If you want to start reading right away, you should read the following parts of How to Design Programs (2nd ed):
The Prologue
Read Chapter 8 and Chapter 9 (up to 9.1) If you find something unfamiliar (e.g., the material references if), see Part 1.
14.1 Beginning Student Language
Racket is a large and complicated language. For the purpose of teaching, it includes smaller sub-languages that are easier to understand. Over the course of the semester, we will build up to more complicated subsets of it. For now, the Beginning Student Language (BSL) omits most of Racket’s advanced features and thus makes it easier to learn.
To use BSL in Racket, go to the Language menu, select Choose Language, and pick BSL from the Teaching Languages section.
14.2 Working with Images
To do the programming tasks in the placement test, make sure you add the following line at the top of your program:
(require 2htdp/image)
Please do not use Racket features like embedded images, embedded comment boxes, etc. While these are all nice, Gradescope does not understand any of them, making it much more complicated for us to read your code. This is really Gradescope’s fault, not Racket’s, but we’re stuck with these tools.
15 The Placement Tasks
This placement test has three parts:
You must complete and submit all three parts.
16 Programming Task 1
16.1 Required Reading
Read the Prologue of How to Design Programs (2nd ed). You won’t need all the content of this part to do the work below (the first portion, through the “Arithmetic and Arithmetic” section, should suffice), but from the next assignment onward you will be defining functions and using conditionals (covered in the rest of the part), so you may find it useful read ahead.
If you want to learn more about Racket’s support for images, see the Quick Introduction.
If you are new to programming: people learn programming by actually writing programs and running them. As you read, type in the code in the document, see how it works, change it a little and see what happens. Actually trying the code in the assigned reading will be essential for you to get comfortable with the material. Do not passively “read” the material: you will get far less out of it than you imagine!
16.2 Task
Create flags of the following countries:
Vietnam
Chile
Suriname
Saint Lucia
Turkey
You should create these flag images using the Racket image primitives (for rectangles, stars, etc.), not by finding the images and pasting them in. You are, however, welcome to use a Web search to figure out what the flags look like.
You may pick the dimensions of your flag, but please make it large enough for us to see (with a width of at least 100), but preferably not so large that we need to scroll a lot to see them all.
For maybe the only time this summer or during the semester, we will not judge you on absolute correctness (e.g., checking whether you got the precise ratios of the different parts right). We’re going to visually eyeball it for general adherence. Of course, feel free to geek out on the vexillological details as much as you wish!
16.3 Grading Standards
This assignment will not be graded. You’ll know when you’ve gotten the flags right; you don’t need us to tell you. However, we still want you to turn in your work so that you have gone through the full cycle of submission. That way things will go more smoothly from the next part, which is graded.
Therefore, please do turn in your work but do not expect any feedback on this assignment.
16.4 Submission
Please write a series of expressions in a single file such that, when the file is Run, the flags appear in the interactions area. If you do use define to give them names, make sure to use these names so that this criterion is met.
Submit the assignment on Gradescope (select Log in with School Credentials, find Northeastern, and use your @northeastern.edu email address. Do not log in with Google, or any other Gradescope account you may have.)
17 Programming Task 2
17.1 Required Reading
Read Chapter 8 and Chapter 9 (up to 9.1) of HtDP 2/e.
If you find something unfamiliar (e.g., the material references if), note that we skipped reading Part 1 so you may need to peek in there to look it up.
17.2 Task
Define the following functions. Even if you think they correspond to a function that already exists, write it yourself. We’re testing your ability to program, not to read documentation!
Some of the problems refer to “words”. You may assume every string represents a word irrespective of its content, i.e., you do not need to check the content unless explicitly asked to do so by the assignment.
score-by-length :: List-of-strings -> Number
Consumes a list of strings that represents words. Produces the sum of the lengths of these words. (Imagine you’re writing a game based on words, and this is a scoring function. We’ll return to this theme.)
overlay-all :: List-of-images -> Image
Consumes a list of images and overlays them, with earlier images in the list over later ones. Use a 10x10 solid white rectangle as the backdrop atop which all other images are overlaid.
Note: You may sometimes find that two images you expect to be equal are reported as not equal by Racket. This is because image equality is an imperfect art. Images that visually appear identical may in fact be very slightly different, causing a test to fail.
bar-graph :: List-of-numbers -> Image
The numbers in the list represent heights of bars in a bar graph (assume they have already been scaled and reflect the desired heights). Generate a bar graph where each bar is a black solid rectangle with a width of 10px, and successive bars are adjacent (use beside/align). Don’t have spaces between the bars.
Use a 1x1 solid white rectangle bar as the base case, so it will always be present as the right-most bar.
You can assume that all the numbers are non-negative.
is-in? :: Any List-of-any -> Boolean
Consumes a value and list of values and determines whether the former is anywhere in the latter: returns #true if it is and #false otherwise.
Use equal? for comparison.
words-to-sentence :: List-of-strings -> String
Consumes a list of strings that represent words. Concatenate these strings with a space between every pair of words.
To write this function, you may not use any built-in string functions other than string-append.
17.3 Grading Standards
This assignment is graded. When you submit the problem, you will receive some basic instant feedback, e.g., if there is typo in the name of a function. After the deadline, you’ll receive more detailed feedback.
17.4 Submission
Create a single file that contains the five functions named above (it can contain any other helper definitions you like as well). The functions must be named exactly as above and must take parameters exactly as above.
Submit the assignment on Gradescope (select Log in with School Credentials, find Northeastern, and use your @northeastern.edu email address. Do not log in with Google, or any other Gradescope account you may have.)
18 Math Task 1
Please answer the following math questions.
Find the numerical value of:
\Sigma_{n=1}^{100} (3n - 5)Let f(x)=x-1 and let g(x)=2x−4. Is there a number C with the property that for all x>C, we have g(x)>f(x)? If so, what is it, and if not, why not?
Don’t just write the answer: also show us why us your solution is correct (e.g., show your steps).
18.1 Submission
Please submit a PDF of your solution, including your work, on Gradescope (select Log in with School Credentials, find Northeastern, and use your @northeastern.edu email address. Do not log in with Google, or any other Gradescope account you may have.)