C++ Test review for tomorrow! In need of help! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C++ Test review for tomorrow! In need of help!

My programming teacher asked us to do the following... please help and answer this for me! Any recommendations on what to specifiacally learn to be able to solve these questions would be a huge help! 1. Correct the errors in the following: a. class Account { public: Account(double b, double r) { // initializing all data members balance = b; rate = r; } static double getRate(){ cout << “Balance: ” << balance << end; return rate; } void getIncreasedBalance () const{ balance += 100; return balance; } private: double balance; static double rate; };

31st Mar 2017, 2:26 AM
Adiel Cowo
Adiel Cowo - avatar
1 Answer
0
getIncreasedBalance should not be constant member function, as it increses a member variable.
31st Mar 2017, 2:32 AM
Shivansh
Shivansh - avatar