Added missing files and removed unnessesary ones

This commit is contained in:
2023-07-16 16:44:42 +03:00
parent c3fa5367c3
commit 199dd693e4
41 changed files with 1442 additions and 50 deletions

40
C++/lesson6/task3.cpp Normal file
View File

@ -0,0 +1,40 @@
#include <iostream>
struct Account {
int number;
int money;
int percentage;
public:
Account(int number, int money, int percentage) {
this->number = number;
this->money = money;
this->percentage = percentage;
}
void refill(int amount) {
money += amount;
}
void withdraw(int amount) {
money -= amount;
}
void PrintInformation() {
std::cout << number << ' ' << money << ' ' << percentage << '\n';
}
};
int main() {
Account* account1 = new Account(21213, 500, 15);
account1->PrintInformation();
account1->refill(200);
account1->withdraw(50);
account1->PrintInformation();
Account* account2 = new Account(1934, 800, 10);
account2->PrintInformation();
account2->refill(150);
account2->withdraw(23);
account2->PrintInformation();
}