예제 #1
0
def main():
    # Określenie salda początkowego.
    start_bal = float(input('Podaj początkową wysokość salda: '))

    # Utworzenie obiektu BankAccount.
    savings = bankaccount2.BankAccount(start_bal)

    # Zdeponowanie pewnej kwoty na koncie.
    pay = float(input('Jaką kwotę zarobiłeś w tym tygodniu? '))
    print('Ta kwota została zdeponowana na koncie.')
    savings.deposit(pay)

    # Wyświetlenie salda bieżącego.
    print(savings)

    # Pobranie kwoty, która ma zostać wypłacona.
    cash = float(input('Jaką kwotę chcesz wypłacić? '))
    print('Ta kwota zostanie odjęta od bieżącej wysokości salda.')
    savings.withdraw(cash)

    # Wyświetlenie salda bieżącego.
    print(savings)
예제 #2
0
def main():
    # Получить начальный остаток.
    start_bal = float(input('Введите свой начальный остаток: '))

    # Создать объект BankAccount.
    savings = bankaccount2.BankAccount(start_bal)

    # Внести на счёт зарплату пользователя.
    pay = float(input('Сколько Вы получили на этой неделе? '))
    print('Вношу эту сумму на Ваш счёт.')
    savings.deposit(pay)

    # Показать остаток.
    print(savings)

    # Получить сумму для снятия с банковского счёта.
    cash = float(input('Какую сумму Вы желаете снять со счёта? '))
    print('Снимаю эту сумму с Вашего банковского счёта.')
    savings.withdraw(cash)

    # Показать остаток.
    print(savings)
예제 #3
0
def main():
    # Get the starting balance.
    start_bal = float(input('Enter your starting balance: '))

    # Create a BankAccount object.
    savings = bankaccount2.BankAccount(start_bal)

    # Deposit the user's paycheck.
    pay = float(input('How much were you paid this week? '))
    print('I will deposit that into your account.')
    savings.deposit(pay)

    # Display the balance.
    print(savings)

    # Get the amount to withdraw.
    cash = float(input('How much would you like to withdraw? '))
    print('I will withdraw that from your account.')
    savings.withdraw(cash)

    # Display the balance.
    print(savings)
예제 #4
0
def main():
    # get the starting balance.
    start_bal=float(input("Please enter your starting balance: "))
    
    # create a BankAccount object.
    savings=bankaccount2.BankAccount(start_bal)
    
    # deposit the user's paycheck.
    pay=float(input("How much were you paid this week?: "))
    print("I will deposit that into your account.")
    savings.deposit(pay)
    
    # display the balance.
    print(savings)
    
    # get the amount to withdraw.
    cash=float(input("How much would you like to withdraw?: "))
    print("I will withdraw that from your account.")
    savings.withdraw(cash)
    
    # display the balance.
    print(savings)