Question

# Write a program that does the following in order: 1. Ask user to enter a name...

Write a program that does the following in order:

1. Ask user to enter a name

2. Ask the user to enter five numbers “amount1”, “amount2”, “amount3”, “amount4”, “amount5”

3. Calculate the sum of the numbers “amount1”, “amount2”, “amount3”, “amount4”, “amount5”

4. If the sum is greater than 0, print out the sum

5. If the sum is equal to zero, print out “Your account balance is zero”

6. If the sum is less than 0, print out “Your account is overdrawn” and the “negative amount”

7. Round all print values to 1 decimal place

Round your sum output to 2 decimal places.

Examples of the program’s inputs and outputs are shown below:

Your account is overdrawn. The overdrawn amount is

\$-92.00

``````#I am using python for this program.

# This will input the name of the program.
# Input amount_1.
amount_1 = int(input('Enter your amount 1:'))
# Input amount_2.
amount_2 = int(input('Enter your amount 2:'))
# Input amount_3.
amount_3 = int(input('Enter your amount 3:'))
# Input amount_4.
amount_4 = int(input('Enter your amount 4:'))
# Input amount_5.
amount_5 = int(input('Enter your amount 5:'))
# sum of all the amounts.
sum = amount_1 + amount_2 + amount_3 + amount_4 + amount_5
if sum > 0:
# printing the sum with 2 decimal places.
if sum == 0:
if sum < 0:
print('Your account is overdrawn. The overdrawn amount is \${:0.2f}'.format(float(sum)))``````

I have added the code snippet and a screenshot of the executed program. If you have any doubts please let me know. If you like the answer please let me know.

#### Earn Coins

Coins can be redeemed for fabulous gifts.