This exercise was developed by Justin Li (Occidental College). It was adapted by Evan Peck (Bucknell)

  • Course: CS 1
  • Language: Python
  • Practice: conditionals, data types, functions
  • Approx. Time: 1-2 hours (depending on revisions)

Scenario: Harwall University’s Visitors

You are working for the prestigious Harwall university to meet the joint needs of Admissions, Alumni Relations, and Communications. People are constantly visiting campus - to see someone they know, to check out the school as a prospective, to give a talk, to interview, to come back to the school (alumni!), or for a variety of reasons.

It would be valuable to know who is on a campus throughout the year, so you are asked to write a standard form that Harwall can give visitors to collect their information. Harwall intends to use the information from this form later on to communicate with potential donors or reach out to prospective students.

Since Harwall wants to make sure that this data is useful, they have also asked you to validate whatever information is entered into the form. That is your job.


Students are presented Part 1 without any ethical framing or knowledge of Part 2.

Instructor Notes: Our sequencing of CS 1 (based off Harvey Mudd’s CS for All) teaches recursion before for and while loops. As a result, you’ll see that the template code uses recursion to repeat a function - feel free to change this based on the sequence in your course (most likely to a while loop).

Supplemental Reading