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
HACTEHA [7]
3 years ago
5

Write a Python program to balance a checkbook. The main function needs to get the initial balance, the amounts of deposits, and

the amounts of checks. Allow the user to process as many transactions as desired; use separate functions to handle deposits and checks.
Computers and Technology
1 answer:
Irina18 [472]3 years ago
5 0

Answer:

def deposit(deposit_amount, balance):

   balance += deposit_amount

   return balance;

def process_check(check_amount, balance):

   balance -= check_amount

   return balance;

balance = float(input("Enter the initial balance: "))

transaction = input("Choose transaction method - D to deposit, C to process check, Q to quit: ")

while transaction != 'Q':

   if transaction == 'D':

       deposit_amount = float(input("Enter amount to be deposited: "))

       balance = deposit(deposit_amount, balance)

       print("Current balance is: " + str(balance))

   elif transaction == 'C':

       check_amount = float(input("Enter amount to process check: "))

       if balance >= check_amount:

           balance = process_check(check_amount, balance)

           print("Current balance is: " + str(balance))

       else:

           print("Not enough money!")

   else:

       print("Invalid input!")

   transaction = input("Choose transaction method - D to deposit, C to process the check, Q to quit: ")

print("Your final balance is: " + str(balance))

Explanation:

- Create functions to handle deposits and checks

- Ask the user for the initial balance and transaction to be made

- Initialize a while loop iterates until the user enter Q

- Ask the deposit amount or check amount depending on the transaction chosen

- Calculate and print the current balance for each transaction

- Print the final balance

You might be interested in
The internet advertisement below is known as a __________. CSS tag web banner title sequence hotspot
AlexFokin [52]

The internet advertisement that is illustrated in the image attached below is known as a: B. web banner.

An internet advertisement can be defined as a promotional multimedia message (information) that is designed and developed with the intention to make products or services that are offered by a business firm to become known and familiar to all of its customers and potential customers over the Internet.

Generally, there are various techniques used by web developers for internet advertisements and these include:

  • CSS tag
  • Title sequence
  • Hotspot
  • Web banner

A web banner is a form of advertising which embeds an advertisement that is delivered by a web server into a webpage over the Internet or the World Wide Web (www).

In conclusion, the internet advertisement that is illustrated in the image attached below is known as a web banner.

Read more on web banner here: brainly.com/question/10196860

8 0
2 years ago
PLEASE HELP TAKING TEST NOW!!! Of the following websites, the least trustworthy is one that (1 point)
Rom4ik [11]

Here's all the right answers.

1. What is the main purpose of a graphic organizer?

Answer: B

2. Which of the following website publishers would be considered an authoritative source about the cultures of ancient Mesopotamia?

Answer: C

3. Which of the following websites is the least biased?

Answer: D

4. Which of the following is true about graphic organizers?

Answer: A

5. Of the following websites, the least trustworthy is one that...

Answer: C

6 0
3 years ago
The Change Control Authority does not have the rights to permitthe change in the software
mestny [16]

Answer:

b) False

Explanation:

The Change Control Authority in software development is a committee consisting Subject Matter Experts(SME) and Technical Chiefs.This committee makes decision whether the changes proposed should be implemented in the software or not.So the correct answer to the question is False.They have the rights to permit changes in the software.

7 0
3 years ago
3. What role can the school play in order to avoid and act against cyber bullying?​
Snowcat [4.5K]

Answer:

below

Explanation:

really nothing because you cant prevent cyberbullying in any way its going to happen at anytime anywhere you can act against it by doing a orginazation to try and prevent it.

6 0
3 years ago
Deb needs to add borders on the cells and around the table she has inserted into her Word document.
slavikrds [6]

Answer:

Design tab

Explanation:

  1. Select the call or table that you will like to use
  2. Then select the <em>design tab</em>
  3. In the group <em>page background</em> select <em>Page Borders</em>
  4. There you will have multiple choses for where you want your border
  5. You can even customize your border by pressing <em>Custom Border </em>at the bottom of the list for <em>Page Borders</em>
4 0
3 years ago
Read 2 more answers
Other questions:
  • The action in which a router divides and forwards incoming or outbound message traffic to multiple links is known as
    15·1 answer
  • Write a SQL statement to display the WarehouseID, the sum of Quantity On Order, and the sum of QuantityOnHand, grouped by Wareho
    7·1 answer
  • Description:
    7·1 answer
  • A domestic air carrier airplane lands at an intermediate airport at 1815Z. The latest time it may depart without a specific auth
    9·1 answer
  • Who created the first photograph
    9·2 answers
  • Egovernment involves the use of strategies and technologies to transform government by improving the delivery of services and en
    7·1 answer
  • Merging refers to dividing a single cell into multiple cells. *TrueFalse
    14·1 answer
  • Hey there! What would be the best way for me to learn Lua script? As well as learn Data Store, and other stuff. Thanks! Brainly
    7·1 answer
  • LAB: Parsing dates Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1,
    10·1 answer
  • you want to run your campaign for your dry-cleaning service across three different publishers, each with different video creativ
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!