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
Escribe un ejemplo de:• Software de aplicación. • Software de diagnóstico. • Software de sistema. ayudenme plis, me toca entrega
Afina-wow [57]

Answer:

1. Software de aplicación: Microsoft Word.

2. Software de diagnóstico: Speccy.

3. Software de sistema: Windows operating system (OS).

Explanation:

Un software puede definirse como un conjunto de instrucciones ejecutables (códigos) o una colección de datos que se utiliza normalmente para instruir a una computadora sobre cómo realizar una tarea específica y resolver un problema en particular.

Básicamente, los softwares se clasifican en tres (3) categorías principales y estas son;

1. <u>Software de aplicación</u>: es un software de usuario final que normalmente está diseñado para realizar tareas y funciones específicas.

Algunos ejemplos de software de aplicación son Microsoft PowerPoint, Notepad, Windows Media player, Firefox, Go-ogle Chrome, Adobe Photoshop, AutoCAD, etc.

2. <u>Software de diagnóstico</u>: estos son programas de software que se utilizan para solucionar problemas y posiblemente reparar un sistema informático.

Algunos ejemplos de software de diagnóstico son Speccy, Windows Sysinternals Suite, System Explorer, hddscan, HWiNFO, SIW (System Information for Windows), CPU-Z, HD Tune, etc.

3. <u>Software de sistema</u>: es un software que normalmente está diseñado para ejecutar el hardware de la computadora y todas las demás aplicaciones de software.

Algunos ejemplos de software del sistema son Linux, Windows OS, Mac OS, WinZip, McAfee antivirus, Norton antivirus, Avast antivirus, Piriform CCleaner, Ubuntu, etc.

8 0
3 years ago
**NEED HELP??!! Computer Science Questions!! KNOWING GIMP!!!!
Svetlanka [38]
<span>1. If my memory serves me well,  the answer is true. Free select tool is also called lasso and it’s used to free-hand selection. You can also combine free select tool segments with polygonal segments or other shapes.

2. I think this statement is definitely “False”. As I’ve mentioned before you can combine free selection with other selection features like polygonal by using anchors.

3. I’m not 100% sure, but I guess this one is true. As far as I remember, add to selection mode lets you to add new selection to any existing areas. So I think it’s possible to add selection to the existing one.

4. I think this one is also true. But it allows you just paint it, but it’s also kinda modification. Quick Mask allows you to isolate subject and paint selected object. It helps you not to brush subject accidentally. It’s a very useful tool as for me.

5. Yes, this statement is 100% true. But it could be gray for GIMP, because the mask is coded in gray tones, but I think that black is also gray tone. Color black or gray removes part of selection, and color white adds area to existing selection.

6. According to what I’ve mentioned before this one is also true, so there’s no need for additional explanation.

7. Another tool, similar to the Lasso/Free Select tool is the B) Scissors Tool. As there was mentioned intelligent scissors tool is almost the same as lasso but more user-friendly.

8. It’s false. You must click to the first point of your selection to finish the process or you will lose your selection.

9. I think this one is true. Paths tool includes two or more line segments connected by handle points. These points are kinda anchors I guess.

10. After making a selection using the Paths Tool, I must select the the D) Selection from Path button to turn my path into a selection. You can find it in path tool options.

11. Yes, it’s true, it allows you to make complex selections with curved or straight lines. Just drag one of the anchors to curve the line. Also you can create different geometrical figures with this tool.

12. Yes this is true. But there are much more cool blur filters than only Gaussian blur. Experiment on your own.

13. You can do all of the following given above. Every layer is kinda isolated image and you can modify it however you want.
<span>
14. I’m definitely sure that this statement is true. Just find layer drop down menu and follow the instructions given in this question. It’s simple.</span></span>
8 0
3 years ago
Select the correct answer.
Vladimir79 [104]

Answer:

I think make a copy maybe

Explanation:

4 0
3 years ago
Read 2 more answers
When should you use the Reply All function when replying to an email
Dmitrij [34]
When the email was sent as a group email 

5 0
3 years ago
Read 2 more answers
Taylor develops a prototype for a new smartphone. It only includes code, a way to process the input, a memory card, and a microp
marysya [2.9K]

Answer:

i would say C.output

Explanation:

the program would be the code, the input would be the input, and the memory card would be the memory leaving the output as the only thing forgotten.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Make a program that (i) asks the user for a temperature in Fahrenheit degrees and reads the number; (ii) computes the correspond
    8·1 answer
  • A snail goes up A feet during the day and falls B feet at night. How long does it take him to go up H feet? Given three integer
    8·1 answer
  • What is the name of the contextual or specific tab that appears in page layout view when adding a header
    15·1 answer
  • What is a expansion card for computer?
    5·1 answer
  • Which device makes computers that are connected to separate segments appear and behave as if they're on the same segment? (Pleas
    11·1 answer
  • Linux is a kind of software whose code is provided for use, modification, and redistribution. what kind of software is this?
    5·1 answer
  • As a general rule, the number of bullet points on a slide should not exceed _____. a.2 b.4 c.8 d.10
    9·1 answer
  • Gabriel's sister called him about a message that suddenly appeared on her screen that says her software license has expired and
    11·1 answer
  • What is the duty of WHH? (white hat hackers)<br><br><br>ANY WHH HERE?<br>​
    8·1 answer
  • to troubleshoot an output component or input device, the first step is to activate the input device that controls the first outp
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!