CSCI0050 Functions Assignment
CSCI0050 Homework: Programming with Functions

Due: Wednesday, July 12 at 6pm (submit through Canvas)

Assignment Goals:
  • To practice developing and testing functions

This assignment combines tables, functions, and lists. Functions are a key part of this assignment. Thus, while you could do this assignment by writing few functions (and creating a lot of definitions), your goal is to write a collection of functions that capture the computations that you need to solve the following problems. We don’t tell you exactly which functions to write (that’s part of what you are thinking about here), but as a general rule you should look to create functions for computations that you might reuse across similar problems to those here.

Collaboration Policy: Your work on this assignment must be entirely your own. Include a collaboration statement attesting that this was your own work.

Exercises: Programming with Functions

Put your answers to these questions in a file named schools.arr.

For this set of problems, you will work with a real dataset about student demographics and test scores from schools across Rhode Island. The data is in a google sheet.

Examples are a key part of this assignment. You should be writing examples/tests for all of the functions you write as part of this assignment, unless a question explicitly states otherwise.

Frequent or Anticipated Questions
Grading and Expectations

In grading, we will look for whether you created functions when appropriate and whether you showed good testing practice on the functions you created. Concretely, we will check:

We will grade your work both on the correctness of output you produce and on the structure of your code. We grade correctness by computer, and style by human inspection. For structure on this assignment, we want to see you using names, comments, and newlines to make your code readable to others.

Remember to include the collaboration statement.

If you want to check whether your file has the same names as our grading scripts will look for, insert the following code at the bottom of your file. This simply looks for the names and types that we stipulated in the assignment. If one of these checks fails, fix your code, not these checks.


    is-function(num-rows) is true

    is-function(low-english) is true

    is-number(math-charters-percent) is true

    (num-rows(strong-me) >= 0) is true

    is-number(both-charters-percent) is true

    (num-rows(poverty-strong-math) >= 0) is true

    is-number(charter-poverty-percent) is true

    is-function(count-by-level) is true



What/how to turn in

Create a directory named functions-hwk. Inside the directory, put a single Pyret file named schools.arr. Submit a zip of the functions-hwk directory. Even though you are submitting only one file, we need the directory to set up the scripts that will run some correctness checks against your homework.

Make sure you follow these directory and file names exactly, or we won’t be able to grade your work.