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
Do most of you agree on a primary interpretation? Why?
Damm [24]

Answer:

yes i do

Explanation:

Primary sources directly address your topic and often provide information that is unavailable elsewhere.

6 0
4 years ago
Como desbloqueo paginas web en windows 7
dimulka [17.4K]

Answer:

WHAT IN EGLISH PLZ

Explanation:

4 0
3 years ago
Consider the given choices and determine which one establishes a conceptual framework for network connectivity.
Snezhnost [94]

Of the given choices, the option that establishes a conceptual framework for network connectivity is OSI model.

<h3>What is network connectivity?</h3>

Network connectivity is a term that tells more about the process of connecting different areas of a network to each other.

Conclusively, the OSI Model often called Open Systems Interconnection Model is known to be the conceptual framework that tells the functions or duties of a networking system.

Learn more about  network connectivity from

brainly.com/question/26956118

5 0
2 years ago
Piers lives in an apartment and has an existing home television connection. He wants to subscribe to a high-speed internet conne
lina2011 [118]

Answer:

D. Wireless Network

Explanation:

A Wireless network has no need for cabling, trunking nor any heavy device installation. a Portable wireless device can solve his problem.

5 0
3 years ago
What is the arc of technology it can't be a brand or app
Maru [420]

aim or audacity or avatar

bluetooth or blogspot

camera or cpu or core

5 0
3 years ago
Other questions:
  • How many possible values will an eight bit audio sample have
    14·1 answer
  • Mike's boss told him he needs to be more efficient. Select each suggestion that will help him become more efficient at creating
    9·1 answer
  • Key differences between software and books include all of the following except
    15·2 answers
  • Which term describes the degree to which a network can continue to function despite one or more of its processes or components b
    14·1 answer
  • _An electronic device used for processing data.
    10·2 answers
  • Which is true about lists and stacks?
    8·1 answer
  • 1. (1 pt) Suppose you wish to run a program P with 37.5 x 109instructions on a 15 GHz machine with a CPI of 0.75. What is the ex
    9·1 answer
  • You dad has given you his old digital scanner for your new computer. you plug it into the usb drive on your windows 8 computer b
    8·1 answer
  • How many of yall are willing too sub to my channel called "Space Juice" with around 200 subs?!​
    11·1 answer
  • Write a program to input a number and check whether it is even or odd number
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!