Last Edited: Mon Mar 18 08:27:01 1996 by jnw (Joseph N. Wilson) on aviator.cis.ufl.edu

CIS 4930 Section 0998X (Spring 1996)

Object-Oriented Programming

Coding Standards

C++ Sample Program

Instructions for submitting programs

Program Assignments

Program 1 (Asst1) (due 24 January 1996)
Write a program in C++ to simulate an egg timer having three buttons (one to increment the number of minutes displayed, one to increment the number of seconds displayed, and one to count the minutes and seconds down until the display reaches zero at which time a bell is rung) and a display supporting two digits for minutes and two digits for seconds.

Use an implementation of the digital counter class described in Exercise 3 on page 56. Add a decrement behavior.

Simulate the behavior of the buttons using the standard input stream and respond to the characters `m' (meaning increment minutes), `s' (meaning increment seconds), and `c' (meaning start the count down). Show the state of the display once after each `m' or `s' button press event, and show each of the display states in counting down after a `c' button press event until the counter reaches 0.

Program 2 (Asst2.dyl) (due on 12 February by 8:00 PM)
Submit a file Asst2.dyl containing class, function, and method definitions necessary to implement a class <egg-timer> that can be used by the following main program: define method main () let x = read-char(); let e = make (<egg-timer>); until (x == 'q') select (x) 'c' => press (e.c-button); 's' => press (e.s-button); 'm' => press (e.m-button); otherwise => print ("I don't know which button that is."); end select; x := read-char (); // to discard carriage return x := read-char (); end until; values (); // to return no printable value end method main;
Program 3 (Asst3.dyl) [You've already done this.]
Program 4 (Asst4.tar) (due on 10 April 1996 by 8:00 PM)
Submit a version of the solitaire program developed by Timothy Budd which incorporates the modification described in execrcise 8 on page 149. To do this, you'll need access to the Interviews installation I've prepared (and am still checking).

Budd's new solitaire version has been installed in ~jnw/Object/solitaire. Be warned that this file contains incompatibilities with the current version of g++ and Interviews that mean it will not compile. See the homework assignment due 29 March. One problem involves the name Card, which is defined by an Interviews include file to be ivCard. Wilson will tell you in class how to avoid this problem.


This document is copyright 1996 by Joseph N. Wilson.