Question: #include #include #include fractionType.h using namespace std; int main() { fractionType num1(5, 6); //Line 1 fractionType num2; //Line 2 fractionType num3; //Line 3 cout cout

#include
#include
#include "fractionType.h"
using namespace std;
int main()
{
fractionType num1(5, 6); //Line 1
fractionType num2; //Line 2
fractionType num3; //Line 3
cout
cout
cout
cout
cout
cout
cin >> num2; //Line 10
cout
cout
//Line 12
num3 = num1 + num2; //Line 13
cout
cout
cout
num3 = num1 - num2; //Line 17
cout
cout
cout
cout
cout
cout = ("
= num2)
cout
cout ("
num2)
cout
return 0;
}
 #include #include #include "fractionType.h" using namespace std; int main() { fractionType
num1(5, 6); //Line 1 fractionType num2; //Line 2 fractionType num3; //Line 3
(30 marks Task-1: Rational fractions are of the orm a/b, in which a and b are integers and b * a la this cuaase, by fractions" we mean rational fractions. Suppose a /b and c/d are fractions. Arithmetic operatioes and selational operations on fractions are definod by the following nules: Arithmetic Operations: labifeld) adbe, in which eld 0 Relational Operations: Fractions are compared as follows: albope dif ad op be, in which op is any of the relational operations For example, albce/d if adbe. In this assignment, you will need to design a class -say, fractiontype which performs the arithmetic and relational operations on fractions. Overload the arithmetic and relationa opcrators so that the appropriatc symbols can be used to perform the opcration. Also, overload the strcam insertion and stream extraction opcratoes for easy input and output. Write a C+ program that using the class EractionType, performs operations on fractions. Among other things, test the following: Suppose x, y, and z are objects of type fraction Type. If the inpet is 23, the statement: cin >>should store 2/3 in x The statement; cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!