using namespace std;
class Account {
private:
int number;
string name;
double balance;
public:
Account();
Account(int createNumber, string createName, int createBalance);
void display();
void set_deposit(int money);
void set_withdraw(int money);
void set_addInterst();
};
#include <stdio.h>
#include <iostream>
#include <string>
#include <windows.h>
#include "account.h"
using namespace std;
Account::Account() {
number = 0;
name = "";
balance = 0;
}
Account::Account(int createNumber, string createName, int createBalance) {
number = createNumber;
name = createName;
balance = createBalance;
}
void Account::display() {
cout << "계좌번호 : " << number << " 이름 : " << name << " 잔고 : " << balance <<"\n";
}
void Account::set_deposit(int money) {
balance += money;
}
void Account::set_withdraw(int money) {
balance -= money;
}
void Account::set_addInterst() {
balance = (balance * 0.03)+balance;
}
#include <stdio.h>
#include <iostream>
#include <string.h>
#include "account.h"
using namespace std;
int main(void) {
Account act1(1543, "loveyou", 5000);
Account act2(1684, "metoo", 2000);
act1.display();
act2.display();
act1.set_deposit(100000);
act1.set_deposit(200000);
act2.set_deposit(50000);
act1.set_addInterst();
act2.set_addInterst();
act1.set_withdraw(50000);
act2.set_withdraw(10000);
act1.display();
act2.display();
return 0;
}