Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For c++ Additional Requirements Use a template so the class works with any kind of number (i.e. int, float, double) fractionType num1(5, 6); fractionType num1(5.1,

For c++

Additional Requirements

Use a template so the class works with any kind of number (i.e. int, float, double)

fractionType num1(5, 6);

fractionType num1(5.1, 6.2);

Tip: get your class working with integer values first for numerator and denominator and convert to a template after it is working with ints. When converting to a template you may need to move all of your implementation into the .h header file.

image text in transcribed

Rational fractions are of the form alb, in which a and b are integers and b*0. In this exercise, by "fractions" we mean rational fractions Suppose alb and cld are fractions. Arithmetic operations on fractions are defined by the following rules: alb + cld -(ad + bc)lbd alb X cld-aclbd (alb)/(c/d)-adlbc; in which cld * 0. Fractions are compared as follows: alb op cld if ad op bc, in which op is any of the relational operations. For example, alb > x; should store 2/3 in x. The statement cout

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_2

Step: 3

blur-text-image_3

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

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions