Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- class Account
- {
- public:
- long long number;
- long double balance;
- double percent;
- int overdraft;
- bool change(double amount)
- {
- if (amount == 0)
- {
- cout << "Не указано сколько вводить/выводить.\n";
- return false;
- }
- else if (balance - amount < overdraft)
- {
- cout << "Недостаточно средств.\n";
- return false;
- }
- else
- {
- balance += amount;
- cout << "Операция выполнена.\n";
- return true;
- }
- }
- };
- void egg()
- {
- while (true)
- {
- system("color 1F");
- system("color 2F");
- system("color 3F");
- cout << "OLOLO NA BASH.ORG!!1111!!1!!1!!!111!!!!1\n";
- system("color 4F");
- system("color 5F");
- cout << "OLOLO NA BASH.ORG!!1111!!1!!1!!!111!!!!1\n";
- }
- }
- int main()
- {
- setlocale(0, "");
- system("color 0A");
- system("title REKTMOBIL`");
- Account test;
- test.number = 1024;
- test.balance = 767;
- test.percent = 0,06;
- test.overdraft = 1000;
- double amount;
- short action;
- while (true)
- {
- cout << "Какую операцию вы желаете выполнить?\n 1 -- ADD\n 2 -- TAKE\n 3 -- BALANCE\n X -- QUIT\n>> ";
- cin >> action;
- system("cls");
- switch (action)
- {
- case 1: cout << "Введите кол-во: "; cin >> amount; test.change(amount); break;
- case 2: cout << "Введите кол-во: "; cin >> amount; test.change(-amount); break;
- case 3: cout << "Ваш баланс: " << test.balance << " YOBA-коинов.\n"; break;
- case 1337: egg(); break;
- default: return 0; break;
- }
- system("pause");
- system("cls");
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment