On this page:
Your Favorite Programming Language

Averages and Things

For this homework set, you will design the average program and write a short essay on your favorite programming language.

The homework has three goals:
  • apply proper program design in your favorite language,

  • get to know the Rust language and start using its documentation,

  • practice descriptive writing on a topic you should like.

Deadline All pieces are due on Friday 23 January NOON.

Your Favorite Programming Language

Describe the most distinguishing features of your favorite programming languages in a essay. Use at most 250 words.

Do: Imagine the chosen language as a concrete object—a painting, a vase, an automobile—and how you would describe its distinguishing features. Use the same kind of thinking for your language.

Don’t: Use any judgmental language. There is no need to convince the reader why it is your favorite language, why it is superior to any other language, inferior to Racket, or anything else.

Draft The draft of the essay is due on Friday 16 January NOON on Ms. Biron’s desk. Drop off a page in person. Make sure the essay displays your email addresses so that Ms. Biron can contact you and meet with you to discuss her corrections.


A weather station collects raw rainfall data and sends it off to some central server where it is stored in a file. A daemon runs an "average" program over such files and uses the output of the program to prepare various displays.

You are in charge of designing the average program. The daemon "pipes" the file into average and expects the output on standard out. Each input line contains one raw measurement. A raw measurement is valid if it can be parsed as a 64-bit floating-point number, e.g., 2 or 2.0 If the raw measurement is invalid or a number less than 0, it is disregarded. If the raw measurement is 999, average stops consuming input; it also stops when the file is exhausted.

The program’s output consists of three lines:
  • the average,

  • the number of measurements in the interval [average,average + 5], and

  • the number of measurements in the interval [average - 5,average].

You started average in class in your favorite programming languages.

Finish your program. Then design average in Rust.