1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lapo4ka [179]
2 years ago
6

You’ve been hired to help a bank automate their deposit/withdrawal system! Your task is to write a Python program that interacts

with a customer in order to process a deposit or withdrawal.
Assume the customer has an initial balance of $1000 (you should store the number 1000 in a variable). Then, ask the user two things:

Whether they want to make a deposit or withdrawal

For this step, they should type a deposit or withdrawal, depending on what they want to do. It needs to be the exact spelling, including capitalization!
How much money they want to deposit or withdraw

For this step, they should enter an integer.
Then, your program should use an if/elif/else statement to do the following:

If the customer is making a deposit, add the amount to their balance.
If the customer is making a withdrawal, subtract the amount from their balance.
If the customer typed something other than "deposit" or "withdrawal", print "Invalid transaction.".
In this case, the customer’s final balance is just the same as their initial balance.
Finally, your program should use an if/else statement to do the following:

If the customer’s final balance would be negative (less than zero), tell them "You cannot have a negative balance!".
Otherwise, report their final balance.
Here are some examples of what running your program should look like:

Example 1:

Deposit or withdrawal: withdrawal
Enter amount: 500
Final balance: 500

Example 2:

Deposit or withdrawal: withdrawal
Enter amount: 1500
You cannot have a negative balance!

Example 3:

Deposit or withdrawal: deposit
Enter amount: 500
Final balance: 1500

Computers and Technology
1 answer:
mixer [17]2 years ago
4 0

Answer: See below

Explanation:

<u>Description:</u> In this program, read-option from the user and based on that, perform the operation. And display the balance if the balance is negative.

<u>transactions.py</u>

balance = 1000

#read options from the user

option = input("Deposit or withdrawal: ")

amount = 0

#check if option is a withdrawal

if option == 'withdrawal':

amount = int(input("Enter an amount: "))

balance = balance - amount

#check option is deposit

elif option == 'deposit':

amount = int(input("Enter an amount: "))

balance = balance + amount

else:

print("Invalid transaction.")

#check balance is less than 0 (negative)

if balance < 0:

print("You cannot have a negative balance!")

else:

print("Final balance:",balance)

You might be interested in
Ms office suite comes with its own set of pictures in the​
goldfiish [28.3K]

Answer:

clipart ...........................

Explanation:

clipart is the correct answer for the above question.

6 0
3 years ago
Fill in the blank
zysi [14]

Client/server networks require <u>specialized</u> software that enables nodes and the server to collaborate on processing and storage.

A server can be defined as a specialized computer system which is typically designed and configured to store and provide specific remote services for its clients (end users), based on a request.

In Computer and Technology, there are various kinds of server and these include:

  • Print server.
  • Database server.
  • Proxy server.
  • Web server.
  • Application server.
  • File server.
  • Virtual server.

In Cloud computing, a client refers to an end user that request for a service over the internet while a server is the specialized computer system which offers this service to a client.

In conclusion, specialized software applications or programs are required for client/server networks, so as to enable nodes and the server collaborate on processing and storage.

Read more: brainly.com/question/21078428

5 0
3 years ago
Which is true about TCP and UDP? Choose two answers.
vichka [17]

Answer:

TCP is a connection-oriented protocol

UDP does not acknowledge a receipt of data

Explanation:

TCP (Transmission Control Protocol) is a protocol to transfer data, this is one of the most important protocols on the entire internet, this method was implemented from the beginning of the network.

UDP (User Datagram Protocol) this is a protocol faster than TCP because this method doesn't establish a connection to sent data, in this case, always sent data, but TCP is more secure than UDP, and for that UDP is used to transfer music or videos, and TCP websites and database.

UDP doesn't need acknowledgment is done by UDP, is only concerned with speed.

7 0
4 years ago
PLEASE HELP WILL MARK BRAINLIEST ASAP
Charra [1.4K]

Answer:

This is a heading

Explanation:

This is a paragraph does not exist. You would simply use p for paragraph. Therefore This is a heading is the correct answer.

8 0
3 years ago
Zander is beginning to take college courses to prepare for a career in computer science, which is the study of using logic to cr
scoundrel [369]

The answer is (A. career definition and career requirements  )


7 0
3 years ago
Other questions:
  • What variation of a dictionary attack involves a dictionary attack combined with a brute force attack, and will slightly alter d
    9·1 answer
  • Describe the effect of a pull up resistor
    7·1 answer
  • Fast we need help What is binary code? Why do computers use binary code?
    8·2 answers
  • Which stage of the waterfall model is most like the simple model's stage 5?
    12·1 answer
  • Memory and processor both have big impact on the performance of a pc. <br>•true <br>•false <br>​
    12·1 answer
  • What is the component on the motherboard that confirms all devices are in working order once the computer is turned on?
    13·1 answer
  • How many passes will it take to find the five in this list?
    14·2 answers
  • Drag the tiles to the correct boxes to complete the pairs.
    12·1 answer
  • How are the functions different and how do i determine the answer
    5·1 answer
  • What is returned by the code: range (20, 100, 20)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!