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

Budget Analysis (use while loop) Write a program that asks the user to enter the amount that he or she has budgeted for a month.

A loop should then prompt the user to enter each of his or her expenses for the month and keep a running total. When the loop finishes, the program should display the amount that the user is over or under budget.
Computers and Technology
1 answer:
Agata [3.3K]3 years ago
6 0

Answer:

print('This program will help you determine whether you\'ve budgeted enough ' +

     'for your expenses. You\'ll just need to enter your budget and the ' +

     'cost of each of your expenses for the month and we will calculate ' +

     'the balance.')

budget = float(input('How much have you budgeted this month? '))

expenses = 0

check = 0

while check >= 0:

   check = float(input('Enter an expense amount or -1 to quit: '))

   if check != -1:

       expenses += check

balance = budget - expenses

if balance < 0:

   print('\nYou haven\'t budgeted enough. You\'re going to be $', \

         format(-1 * balance, ',.2f'), ' short this month.', sep = '')

elif balance == 0:

   print('\nBe careful. You\'ve budgeted just enough to make it through ' +

         'the month.')

else:

   print('\nYou will have $', format(balance, ',.2f'), ' extra this month.', \

         sep = '')

You might be interested in
How to find out what version of windows i have?
Sholpan [36]
Look in for setting under system settings, that should show what software and firmware version you are on.
3 0
4 years ago
a ____ consists of wires connecting the cpu and other parts of the computer. The _____ transfers data between CPU and memory uni
geniusboy [140]

Answer:

A power supply consists of wires connecting the cpu and other parts of the computer. The data bus transfers data between CPU and memory unit.

Explanation:

4 0
3 years ago
What is the encoding technique called that is used to store negative numbers in the computer's memory
Anna007 [38]

Answer:

The following “ encoding techniques “ can be used to “ store negative numbers in a computers memory: “ “ Signed magnitude representation (SMR).

Explanation:

hope it helps.!!

6 0
2 years ago
Ethernet is a standard for a) LAN b) MAN c) WAN d) All of the above
kotykmax [81]

Answer:

a) LAN

Explanation:

Ethernet is a standard for a IEEE or LAN.

7 0
3 years ago
Read 2 more answers
When you think that the internet is helpful and you find whatever you want to know, So you fool yourself, almost nobody is profe
Anni [7]
Is there a question, or just free points?
5 0
4 years ago
Other questions:
  • What special identity group specifically includes any user account (except the Guest) logged into a computer or domain with a va
    14·1 answer
  • Which statement is an example of an opinion from an online source?
    14·2 answers
  • A(n)…………is the interface used toconnect external devices to the computer.
    5·1 answer
  • Excel recognizes an entry as a value if it is a number or it begins with ____
    8·1 answer
  • Can somebody help I need it now please and thank you correct answer please
    10·2 answers
  • 2<br><br> What combination of keys turns the value in a cell into a percentage?
    12·1 answer
  • If a triathlon is a sport combining three events, what do you think would be the word for a sport combining five events?
    7·1 answer
  • 1. Write an application that throws and catches an ArithmeticException when you attempt to take the square root of a negative va
    11·1 answer
  • Can’t be opened because apple cannot check it for malicious software.
    15·1 answer
  • 9.2.8 last names codehs
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!