CS 176, Introduction to Computer Science II

Summer 2001 - Lab Test 1


Implement the jackrabbit-population model you designed last week, and use it to write a program that answers the following questions:

Given two jackrabbit ecosystems with

start1 = 7 and max1 = 128

and

start2 = 51 and max2 = 1024

  1. Which jackrabbit ecosystem runs out of food first? That is, for which jackrabbit ecosystem does seasons return the smallest value? Your program should print out first or second on a line by itself, depending on which ecosystem runs out of food first.

  2. At which breeding season does the total number of rabbits in the first ecosystem first equal or exceed the initial number of jackrabbits in the second ecosystem? Your program should print the number on a line by itself.
Submit your test files using the command

/export/home/us/csfac/cs176-summer2001/bin/submit-lab-test your-files-here

where your-files-here are a list of the source files you've written for the test (your shell may let you abbreviate the command as ~csfac/cs176-summer2001/bin/submit-lab-test). You should get an e-mail response back in a few minutes. submit-lab-test is available from any linux system.

Make sure you submit something by the deadline. Unlike your programming assignments, you will not be able to submit you lab test after the 12:15 p.m. deadline.


This page last modified on 25 June 2001.