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

 

pierre1.cpp

// pierre1.cpp solves chef Pierre's fraction multiplication problem
//  using a Fraction class and I/O function members.
//
//  Author: Joel C. Adams, for Hands On C++.
//  Date: April 1994.
//  Revised: October 1997.
//  Uncommented by: 
//
//  Input: Two Fraction values.
//  Precondition: Neither Fraction has a denominator of zero.
//  Output: The product of the two Fractions.
//**********************************************************

#include <iostream> using namespace std;

#include "Fraction.h"

int main() { // Fraction oldMeasure; // Fraction scaleFactor(1,6); // Fraction newMeasure;

cout << endl << "To convert fractional measures,\n"; cout << " enter the fractional measure you want to convert: "; // oldMeasure.Read(cin);

cout << endl << "Enter the fractional amount to reduce/increase it by: "; // scaleFactor.Read(cin);

// newMeasure = oldMeasure * scaleFactor;

cout << endl << "The fractional measurement is: "; // oldMeasure.Print(cout); cout << endl << endl;

cout << endl << "The fractional amount is: "; // scaleFactor.Print(cout); cout << endl << endl;

cout << endl << "The converted measurement is: "; // newMeasure.Print(cout); cout << endl << endl; }

 
  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: Tuesday, November 13, 2001 at 9:53:30 AM.
visitors to this page.