View difference between Paste ID: j62Fj0ar and XS7UhNtb
SHOW: | | - or go back to the newest paste.
1-
def glowne_menu():
1+
def main_menu():
2-
    print("Wybierz opcje:")
2+
    print("Select an option:")
3-
    print("1. Wpłata")
3+
    print("1. Deposit")
4-
    print("2. Wypłata")
4+
    print("2. Withdrawal")
5-
    print("3. Sprawdzenie stanu konta")
5+
    print("3. Check account balance")
6-
    print("4. Zakończ")
6+
    print("4. Exit")
7
8-
def pobierz_wybor_klienta():
8+
def get_customer_choice():
9-
    return int(input("twój wybór to: "))
9+
    return int(input("your choice is: "))
10
11-
def pobierz_kwote(tekst):
11+
def get_amount(text):
12-
    return float(input(tekst))
12+
    return float(input(text))
13
14-
def pokaz_stan_konta(saldo):
14+
def show_account_balance(balance):
15-
    print(f"Stan konta wynosi {saldo} złotych")
15+
    print(f"The account balance is {balance}")
16
17-
def wplata(saldo):
17+
18-
    kwota_wplaty = pobierz_kwote("Ile chcesz wpłacić")
18+
def deposit(balance):
19-
    saldo = saldo + kwota_wplaty
19+
    deposit_amount = get_amount("How much would you like to deposit?")
20-
    pokaz_stan_konta(saldo)
20+
    balance = balance + deposit_amount
21-
    return saldo
21+
    show_account_balance (balance)
22
    return balance
23
24-
def wyplata(saldo):
24+
25-
    kwota_wyplaty = pobierz_kwote("Ile chcesz wypłacić")
25+
def withdrawal(balance):
26-
    if kwota_wyplaty > saldo:
26+
    withdrawal_amount = get_amount("How much would you like to withdraw?")
27-
        print("Operacja nie udana, za mało środków na koncie")
27+
    if withdrawal_amount > balance:
28-
        return saldo
28+
        print("Operation failed, not enough funds on the account ")
29
        return balance
30-
        saldo -= kwota_wyplaty
30+
31-
        print(f"Wypłacono {kwota_wyplaty} złotych")
31+
        balance -= withdrawal_amount
32-
        return saldo
32+
        print(f"The amount withdrawn {withdrawal_amount}")
33
        return balance
34-
#powyżej nich będziemy pisać wszystkie funkcje naszego programu!!!
34+
35-
wybor = 0
35+
#we write all the functions of our program above!!!
36-
saldo = 0
36+
choice = 0
37-
#poniżej będzie główna pętla programu
37+
balance = 0
38-
while wybor != 4:
38+
#below is the main loop of the program
39-
    glowne_menu()
39+
while choice != 4:
40-
    wybor = pobierz_wybor_klienta()
40+
    main_menu()
41-
    if wybor == 1:
41+
    choice = get_customer_choice()
42-
        saldo = wplata(saldo)
42+
    if choice == 1:
43
        balance = deposit(balance)
44-
    elif wybor == 2:
44+
45-
        saldo = wyplata(saldo)
45+
    elif choice == 2:
46
        balance = withdrawal(balance)
47-
    elif wybor == 3:
47+
48-
        pokaz_stan_konta(saldo)
48+
    elif choice == 3:
49
        show_account_balance(balance)
50-
    elif wybor == 4:
50+
51-
        print("Wyłączanie bankomatu")
51+
    elif choice == 4:
52
        print("Shutting down the ATM")
53
        pass
54-
        print("niepoprawne dane")
54+
55
        print("Invalid data")
56
        pass
57
    pass
58
59