Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using namespace std; / * NumberList::NumberList ( ) { } NumberList::NumberList ( int l , double n ) { } NumberList::NumberList ( int l ,
using namespace std;
NumberList::NumberList
NumberList::NumberListint l double n
NumberList::NumberListint l const double a
NumberList::NumberListconst NumberList & nl
void NumberList::print
int NumberList::getLength
double NumberList::sum
double NumberList::ave
double NumberList::max
double NumberList::min
bool NumberList::isIndouble n
bool NumberList::pushdouble value
bool NumberList::pop
void NumberList::readistream & inStream
if&inStream &cin
else
file structure: first line contains the number of numbers in the list
remaining lines contain the numbers each separated by a whitespace
bool NumberList::insertdouble number, int position
SELECTION SORT algorithm
void NumberList::sortchar type
bool NumberList::operatorconst NumberList& rhs
NumberList& NumberList::operatorconst NumberList& rhs
avoid selfassignment, only do assignment if RHS is a different object from this
ifthis &rhs
return this;
NumberList& NumberList::operatorconst double& number
iflength
cout "Unable to perform list is filled to capacity
;
else
return this;
NumberList& NumberList::operatorconst NumberList& rhs
iflength
cout "Unable to perform list is filled to capacity
;
else iflength rhslength
cout "Unable to perform list would be over capacity
;
else
return this;
FOR EXTRA CREDIT ON THIS PROJECT GRADE, OVERLOAD THE FOLLOWING OPERATORS
AS NONMEMBER FUNCTIONS
ostream& operatorostream& out, const NumberList& nl
const NumberList operatorNumberList& lhs const double& number
const NumberList operatorNumberList& lhs const NumberList& rhs
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started