Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following information, located on Github m03, are provided as a starter. Frac.h, a complete Frac Class Declaration ( the definition is to be complete

The following information, located on Github m03, are provided as a starter.

  1. Frac.h, a complete Frac Class Declaration ( the definition is to be complete by you.)
  2. testFrac_starter.cpp, a working program with partial Frac members defined to get you started.

Please follow the TODO List below to finish all Class definitions, and to expand the starter to exercise and verify all the Frac member methods.

Project Requirement

The form and format the Fractional number to be used

In this project, We are only going to

(1) use two numbers: numerator over denominator to represent a fraction, no mixed numerals.

(2) allow the usage of the proper and improper fraction:

  • Proper Fraction: the number is inferior to the denominator, for instance 3/4 ;
  • Improper fraction: the numerator is superior to the denominator, for instance 9/2 ;

We are not going to use Mixed Fraction and Equivalent Fractions:

  • Mixed Fraction or Mixed Numeral: it is composed of a whole part and a fractional one, for instance 2 1/3 ;
  • Equivalent Fractions: fractions that keep on the same proportion of another fraction, for instance: 5/2 =10/4; All Fraction shall be the minimum number representation.

Part-2

Sequence of operations in 1 statements vs. 6 statements 5 pts

To include the Special ++/-- Test Pattern (inside the testFrac_starter.cpp) as part of your final test program.

 // line #74 onward cout << " Please observe the outputs of identical commands " << " executed in one statement v. separated statements. "; Frac f(5,6); cout << f << " " // start << --f << " " << f << " " << ++f << " " << --f << " " << ++f << endl; // end of one statement cout << f << " " ; cout << --f << " " ; cout << f << " " ; cout << ++f << " " ; cout << --f << " " ; cout << ++f; cout << " Why the above output values are not the same? ";

After successfully implemented and executed your program:

Final Check List

  • To complete all method's definition based on the following member method declaration of the Frac Class for Project 1. (the declaration only Frac.h in Github m03 folder)
  • Complete the testFrac.cpp program (testFrac_starter.cpp is provided in Github). Please expand the tester to make sure all the Frac member methods are verified with your own tester.
  • Make sure no error or any unverified member methods (point deduction)
  • Provide the reason/explanation on why the increment/decrement test sequence (one statement vs 6 statements) produce different outcome.

Submit

  1. testFrac.cpp (a starter is provided in Github)
  2. Frac.h or you may combine into one single testFrac.cpp
  3. Verification (All Frac class members test requirement 1-6 must be tested)
  4. Explanation of the different output pattern on running the special ++/-- test provided for this project.

Part-2 (5 pts) for the explanation for the behavior observed by running the provided test pattern:

six (6) operations in one statement vs. six (6) operations in six (6) statements.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

Define procedural justice. How does that relate to unions?

Answered: 1 week ago