Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Calculate the Balance - Deposit If the action is Deposit 'D', use a deposit function to add funds to the account Write a function called

Calculate the Balance - Deposit

If the action is Deposit 'D', use a deposit function to add funds to the account

Write a function called `deposit`.

Request from the user the amount to be deposited. This value should be stored in a variable called `deposit_amount`. Use both the `input` and `float` methods in order to ensure the `deposit_amount` is a float value.

Calculate a new account balance.

The calculation for depositing funds into the account is `account_balance = account_balance + deposit_amount`.

Print the new account balance.


Deposit Input

userchoice = input ("What would you like to do?\n")  userchoice = 'B'  deposit_amount = 200

Deposit Output

What would you like to do?  How much would you like to deposit today?  Deposit was $200, current balance is $700.25

Customer Deposit

Check It!Show diff

LAST RUN on 2/21/2020, 12:30:14 AM


Check 1 failed  Output:  What would you like to do?  How much would you like to deposit today?  Deposit was $200.00, current balance is $700  Expected:  What would you like to do?  How much would you like to deposit today?  Deposit was $200.00, current balance is $700.25

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Here is a Python function called deposit that performs the deposit operation and prints the new acco... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Banking questions

Question

=+What is the EVPI?

Answered: 1 week ago

Question

Convert binary to decimal 1 1 1 1 0 0 2 1 0

Answered: 1 week ago

Question

What is meant by disparity in sentencing?

Answered: 1 week ago