Placement Test
Registration
The placement test starts on June 17. But, you can register late by emailing blerner AT ccs.neu.edu.
Dates
The placement test will run from June 17 – July 31. 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.
Questions
What should I do to prepare before June 17? 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 blerner AT ccs.neu.edu if you have any questions.
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:
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.
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.
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. None of these are necessary or helpful for this assignment, and will mostly make it more difficult for us to read and evaluate your code.
The Placement Tasks
This placement test has three parts:
You must complete and submit all three parts.
Submission instructions:
For this assignment, you will submit a zip containing three files: two Racket files with your answers to the first two problems, and a PDF with your answer to the third problem. To create a zip file:
On Windows: in Explorer, select the files you want to compress, right-click on them, and select Send to, and then select Compressed (zipped) folder.
On Mac: in Finder, select the files you want to compress, control-click on them, and choose Compress.
On Linux: Open a terminal to the directory containing your files, and run
zip archive.zip problem1.rkt problem2.rkt math.pdf where archive.zip is the name of the file you want to produce, and problem1.rkt, problem2.rkt and math.pdf are the names of the files you want to compress.
To log in to Handins-placement, your username is the account name before @northeastern.edu in your Northeastern email address, and your password is your nine-digit NUID number (if your number is shorter than nine digits long, add leading zeroes, as in 001234567). This account (and this server!) is temporary for the summer, and will not be your login during the semester.
Note: Handins will only accept a maximum unzipped file size of 5MB, so please ensure your files are small enough (e.g. don’t include huge images in your files!).
You can find a detailed how-to guide to the handin server here. (For now, focus on section 8, “Submitting an assignment file”; the other sections will become relevant during the semester.)
Programming Task 1
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!
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!
3 Grading Standards
This assignment will not be manually 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.
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. Name your file either problem1.rkt or flags.rkt. If you do use define to give them names, make sure to use these names so that this criterion is met.
Programming Task 2
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.
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.
3 Grading Standards
This assignment is graded. When you submit the problem, you will receive some basic style feedback, e.g., if your indentation is incorrect, or if your lines are too long. The manual grading will not be available until after the deadline.
Your goal should not be merely to “make your code work”. Your goal should be to make your code legible enough and convincing enough that it’s obvious that it works. We are not looking for “the shortest” code, or “the fastest” code, or “look I used a library to do it for me” code. We will spend plenty of time during the semester defining what “obviously correct” means more carefully; for now, write what you think is the clearest code you can.
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. Name your file either problem2.rkt or functions.rkt.
Math Task 1
Please answer the following math questions.
Find the numerical value of:
\sum_{n=1}^{100} (4n - 6)Let f(x)=x-1 and let g(x)=2x−8. 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).
1 Submission
Please submit your solution as a PDF file.