University of Iowa Computer Science Department

Quiz 04

1. Write a class to describe a rational number, i.e., a ratio of two integers. Name the class RationalNumber and include two instance variables called numerator and denominator. Include a constructor that initializes the two instance variables. Show a statement to create the rational number 1/3.

2. What are properties and how do you define them and use them?

CLAS CRA ACM | ©2005 The University of Iowa | Modified: February 24, 2005, 18:54:58.