C++ program help

Anonymous
timer Asked: Nov 8th, 2016

Question description

I need help to do my C++ program! If you are very good at C++ language contact me please! The file of the program that i need help with is attached in here.

Copy the file for Test 1 and place the contents into a .cpp file in a Visual Studio Project.
If you like you can create a separate header file.

Write all of functions listed. You can run and test your member functions if you like, but that is not required.

NOTE:
Add the following to VS 2015 cpp files to disable the warning that strcpy and strncpy are unsafe.
#pragma warning(disable:4996)

Submit the .cpp file containing all of the code that you have written.


Thanks!

// CALL FUNCTIONS - IF POSSIBLE // AVOID WORK VARIABLES - IF POSSIBLE // CHAIN FUNCTIONS - IF POSSIBLE // // You CANNOT write any helper functions of your own you can only use the functions given in the class definition #include using namespace::std; class coin { friend ostream & operator << ( ostream &, const coin &); friend bool operator == ( int n, const coin & right); // will return true if n is equal to the count field of right public: coin(void); coin(int ct, const char * d); coin(const coin &); ~coin(void); int getCount(void) const; coin & setCount(int n); coin & setDesc( const char *); the paramater const coin & getLarger( const coin & ) const; // will return as an alias the larger coin // , i.e. larger of the invoking instance and // use getCount() to determine the largest const coin & operator = ( const coin &); coin operator + ( const coin & ) const; // return coin with counts added // same desc as the invoking instance bool operator == ( const coin &) const; // return true if the counts are equal bool operator == ( int v) const; // return true if v is equal to the count field private: const char * getDesc(void) const; int count; char desc[25]; }; class bank { friend ostream & operator<<(ostream &, const bank &); public: bank(void); bank(int, const char * coinDesc, const char * ownerName); bank(const bank &); bank( const coin &, const char * ownerName); ~bank(); int getCount(void) const; bank & changeOwner( const char *); const bank & operator = (const bank &); bool }; // operator == ( const bank & ) const; // will return true if the owners are equal as strings // and coin fields data are equal as coins bool operator != ( const bank &) const; private: coin data; char * owner; Write the Class functions ostream & operator << ( ostream & w, const coin & c) { } bool operator == ( int n, const coin & right) // will return true if n is equal to the count field of right { } coin::coin(void) { } coin::coin(int ct, const char * d) { } coin::coin(const coin & other) { } coin::~coin(void) { } int coin::getCount(void) const { } const char * coin::getDesc(void) const { } coin & coin::setCount(int count) { } // coin & coin::setDesc( const char * c) { MUST USE THE PARAMETER NAME OF COUNT } const coin & coin::getLarger( const coin & right ) const { } // In the above function, explain the 3 uses of const const coin & coin::operator = ( const coin & right) { } coin { coin::operator + ( const coin & right) const // // return coin with counts added same desc as the invoking instance } bool coin::operator == ( const coin & right) const // return true if the counts are equal { } bool coin::operator == ( int v) const // return true if v is equal to the count field { } // ****** bank functions ******* ostream & operator<<(ostream & w, const bank & b) { } bank::bank(void) { } bank::bank(int a, const char * coinDesc, { } bank::bank(const bank & other) { const char * ownerName) } bank::bank( const coin & c, const char * ownerName) { } bank::~bank() { } int bank::getCount(void) const { } bank & { bank::changeOwner( const char * c) } const bank & bank::operator = (const bank & right) { } bool bank::operator == ( const bank & right ) const { // will return true if the owners are equal as strings // and the coin fields are equal as coins } bool { bank::operator != ( const bank & right ) const } // ***************************************************************************** // Client functions coin returnLarger( const coin & left, const coin & right) // will return the larger coin, based on the count value // the desc of the coin returned will be "Larger Coin"; { // write returnLarger now } void main() { coin a(4,"Dime"); coin c(5,"Penny"), d(12,"Quarter"), e(15,"$20 Gold Coin"), f; bank b(24,"Dollar Bill", "John Doe"); cout << a << b << c; // Write the above using function notation: // ________________________________________________________ f = (c + d) + e; // Write the above using function notation NOTE: There are 3 operators: } // __________________________________________________________ return;
Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags
Study Guides

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors