add tax logic to the game

This commit is contained in:
nyosic 2025-02-08 01:13:31 +01:00
parent 2029666ea5
commit b81d89a63c
2 changed files with 7 additions and 6 deletions

BIN
main

Binary file not shown.

View File

@ -299,9 +299,10 @@ void withdraw() {
cin >> withdraw_amount;
if (balance >= withdraw_amount) {
balance -= withdraw_amount;
bank_balance += withdraw_amount;
bank_balance += withdraw_amount * 0.76;
system("clear");
cout << "Deposit successful! Your new balance is: " << balance << " NyscoCoins" << endl;
cout << "Deposit successful! Your new bank balance is: " << bank_balance << "$ (after tax)" << endl;
cout << "Gambling is also taxed!" << endl;
sleep(3);
system("clear");
}
@ -328,9 +329,9 @@ void work() {
system("clear");
cout << "\nWork done!" << endl;
sleep(3);
int money_recieved = work_days * 20;
bank_balance += money_recieved;
cout << "\nYou recieved " << money_recieved << "$ for working " << work_days << " days." << endl;
int money_recieved = work_days * 120;
bank_balance += money_recieved * 0.88;
cout << "\nYou recieved " << money_recieved * 0.88 << "$ (after tax) for working " << work_days << " days." << endl;
sleep(3);
system("clear");
}
@ -362,7 +363,7 @@ int main() {
cout << "(D) - Dice Roll" << endl;
cout << "(H) - Higher or Lower (coming soon!)" << endl;
cout << "--------------------" << endl;
cout << "(J) - Go To Work" << endl;
cout << "(J) - Go To Work (best option btw! don't gamble it's bad)" << endl;
cout << "--------------------" << endl;
cout << "(M) - Deposit Money" << endl;
cout << "(W) - Withdraw NyscoCoins" << endl;