12.5 Placement 2
On this page:
12.5.1 Language
12.5.2 Library
12.5.3 Reading
12.5.4 Programming Tasks
12.5.5 Math Tasks
12.5.6 Grading Standards
12.5.7 Turnin

12.5 Placement 2

12.5.1 Language

For the following assignment, you must use Racket’s Beginning Student language. Go to the Language menu, select Choose Language, and pick the language from the Teaching Languages section.

12.5.2 Library

To do these assignments, make sure you add the following line at the top of your program:
(require 2htdp/image)

You may also find some string functions useful.

12.5.3 Reading

Read Part 2 of HtDP 2/e, specifically chapters 8 and 9 through 9.1 (you don’t need to go further).

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.

12.5.4 Programming Tasks

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!

12.5.5 Math Tasks

Please also answer the following math questions.You will answer these directly on the form, so there is no hand-in file associated with them.

  1. Find the numerical value of: \[\sum_{n=1}^{100}4n -3\]

  2. 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)\)? Explain your reasoning.

12.5.6 Grading Standards

This assignment onward will be graded.

From this assignment onward, for the rest of the placement and the course, you will be graded on both the quality of your code and the correctness of your answers:
  • The latter will be (mostly) graded by computer, so it’s vital you follow the problem specification exactly. If you do not, the grading software will almost certainly assign you a zero. We will not fix these mistakes by hand. If, from prior computing courses, you are accustomed to your instructor fixing these problems for you, please be aware that that won’t happen here.

  • The former will be (mostly) graded by hand, and we will look for how well you have presented the parts expected by the Design Recipe. The components we care about are data definitions, purpose statements, function signatures, and tests.

    You must follow the Recipe both for required functions and for any helper functions you write.

Both parts are equally important. (For the math, we will similarly check both the correctness of your answer and the soundness of your reasoning.)

When writing tests, imagine that you aren’t just testing your own implementation. Suppose you are instead being asked to write tests to grade someone else’s work. What cases do you need to cover? What are some ways they might have gotten the problem wrong?

12.5.7 Turnin

Please turn in 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. Please name your file p2-code.rkt. (Note: Google Drive will automatically rename your file(s) to include your name. This is fine.)

Failure to follow any of these instructions may result in zero credit.

Upload your file here. You will need to be logged into the Google@Brown domain to upload.