Starting from:

$35

COSC6000 Homework 07 Solved

In HW5, we have developed a class called USLength that is an abstract data type (ADT) for a length. In this HW, we modify the class.

 Divide your class code  into two parts:

USLength class header file USLength.h

USLength class implementation file USLength.cpp

Determine namespace name as you like. (ex. your name, your initial...) Define your USLength class under the namespace.

Add following overloaded operators.

operator + to compute (USLength object) + (USLength object) operator += to compute (USLength object) += (USLength object) operator * to compute (USLength object) * (int) operator * to compute (int) * (USLength object) operator / to compute (USLength object) / (int) operator *= to compute (USLength object) *= (int) operator /= to compute (USLength object) /= (int) operator < to evaluate (USLength object) < (USLength object) operator <= to evaluate (USLength object) <= (USLength object) operator to evaluate (USLength object) (USLength object) operator = to evaluate (USLength object) = (USLength object) operator == to evaluate (USLength object) == (USLength object) operator << to perform (ostream object) << (USLength object) Use call­by­referece for input arguments if possible.

Add “const” modifier for input arguments that are not modified in function body.

Add “const” modifier to member functions that do not change member variables.

Develop main.cpp to test your USLength class. You will have three files to upload.


https://tulane.instructure.com/courses/2165899/assignments/13466511                                                                                                                                                                   2/2

More products