Lab 1420 - Crickets


There is a cricket that lives by our timeshare in Myrtle Beach, South Carolina. Most every night I hear it patiently chirping away. Some nights it chirps faster than others, and it seems like the warmer it is, the faster it chirps. There are many crickets, and each of them seems to behave the same. On several different nights, armed with a stopwatch and a thermometer, I recorded the frequency of the chirps and compared it to that night's air temperature.

Experimental Results

The chirping follows a simple linear formula: take the number of chirps, add 40 and divide that sum by four to get the temperature in degrees Farenheit.


To model the crickets, create an Environment class that knows and can return the current temperature. Create a Cricket class that chirps, or for simplicity, returns how many chirps per minute the cricket would make at that temperature.

Extension: There is a cricket variety in some parts of South Carolina that is a little slower than most normal Carolina crickets. Add a ClemsonCricket class that extends Cricket but chirps slower by 20%.

Copyright © 2010 by Asylum Computer Services LLC Return to CS Labs