1. This assignment asks to add some code from to a previous assignment I had . A
ID: 3554058 • Letter: 1
Question
1. This assignment asks to add some code from to a previous assignment I had.
A) overload the >> operator to allow for reading a new name and new balance from the keyboard and use the data to update the object's data members
B) Overload the << operator to dsiplay the Name, Balance, and Interest Rate of an object on the screen with proper labels.
C) Overload the += operator to allow an increase to a saver's Balance. (Saver1 += 1000;) use a void member function
D) Overload the -= operator to allow a decrease to a saver's Balance. (Saver1 -= 1000;) Use a void member function.
E) create a 4th object and use it to test all the member functions and overloaded operator functions.
here are the links to the three files for the pervious project:
https://www.dropbox.com/s/g7k595h2hmsvi58/SavingsAccount1.h
https://www.dropbox.com/s/d8z9nuhlvl4i5bj/Savingsmain.cpp
https://www.dropbox.com/s/hsm97wvscj6ot3c/SavingsAccount1.cpp
here is the assignment as well from the pervious probject:
Explanation / Answer
Use a friend method to overload those operators, for example
The other operators are similar to the above. For the >> operator use istream instead of ofstream and call it with cin
For the << operator which I showed you how to code you just open an output stream.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.