0

Help pls Tracking your bank account C++

What do I do?

8th Oct 2021, 9:40 AM
Boong Bing
8 Answers
+ 2
Alena Sherine before that, link your bank details so he can track itđŸȘ“
8th Oct 2021, 10:01 AM
Simba
Simba - avatar
+ 1
Simba i supposed that he is asking about banking system project 😄
8th Oct 2021, 10:16 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Thank you I appreciate your help! :)
9th Oct 2021, 5:04 AM
Boong Bing
+ 1
//your code goes here Account operator+(Account &obj){ Account res; res.balance = this -> balance + obj.balance; res.interest = this -> interest + obj.interest; return res; }
15th Oct 2021, 5:09 AM
Khomi TAKAYANAGI
Khomi TAKAYANAGI - avatar
0
Link your code here so we can check better where u stucked
8th Oct 2021, 9:50 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
#include <iostream> using namespace std; class Account { private: int balance=0; int interest=0; public: Account() {} Account(int a): balance(a) { interest += balance/10; } int getTotal() { return balance+interest; } //your code goes here Account operator+ (Account&obj){ } }; int main() { int n1, n2; cin >> n1 >> n2; Account a(n1); Account b(n2); Account res = a+b; cout << res.getTotal(); }
9th Oct 2021, 4:15 AM
Boong Bing
0
#include <iostream> using namespace std; class Account { private: int balance=0; int interest=0; public: Account() {} Account(int a): balance(a) { interest += balance/10; } int getTotal() { return balance+interest; } //your code goes here Account operator+ (Account&obj){ Account res; res. getTotal()=this->getTotal()+obj.getTotal(); return res; } }; int main() { int n1, n2; cin >> n1 >> n2; Account a(n1); Account b(n2); Account res = a+b; cout << res.getTotal(); }
9th Oct 2021, 4:38 AM
Boong Bing
0
Try this one is it showing correct output according to your inputs https://code.sololearn.com/ce9FBw06v9hx/?ref=app
9th Oct 2021, 5:02 AM
A S Raghuvanshi
A S Raghuvanshi - avatar