course.wilkes.edu/CS125Labs
Welcome to the site for CS 125 labs!

 

Lab 10: Instructor's Notes

Prev | Next | Lab 11

This exercise leads students through the creation of a Fraction class by which fraction objects can be represented. The exercise consists of two parts:

  1. Part 1 builds the basic Fraction class, using only function members. The required files are pierre1.cpp, Fraction.h, Fraction.cpp, and Fraction.doc. In addition to constructors, extractors, and I/O member functions, students learn to overload the multiplication operator (*) using a function member of the Fraction class.
  2. Part 2 extends part 1, by teaching students to overload the insertion and extraction operators for Fraction objects. The needed file is pierre2.cpp.
If you do not wish to have your students learn about overloading the insertion and extraction operators, feel free to skip Part 2.

Makefile10 is provided to facilitate the translation of these files. It contains both pierre1 and pierre2 as targets: to translate pierre1.cpp, simply use make; to translate pierre2.cpp, use make pierre2.

As usual, if you wish to avoid network delays, save copies of these files ahead of time refer your students to your local copies.

Prev | Next | Lab 11

 
  Home

Help

Lab 0

Lab 1

Lab 2

Lab 3a

Lab 3b

Lab 4

Lab 5

Lab 6

Lab 7

Lab 8

Lab 9

Lab 10

Lab 11

Lab 12

Lab 13



Membership

Login




Last update: Friday, August 25, 2000 at 11:18:23 AM.
visitors to this page.