answer.
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]
1 year 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]1 year 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
What permanent magnets of a motor are replaced with more powerful ones, what effect do you think this would have on motor rotati
Marat540 [252]
When permanent magnets of a motor are replaced with more powerful ones, the motor rotation will increase. This is because there is more electricity being generated.
7 0
2 years ago
Read 2 more answers
Which perspective is usually used in process simulations?
emmainna [20.7K]

Answer:

C. Omnipresent

Explanation:

Just took the test on Plato

#PlatoLivesMatter

#YeetLife

7 0
2 years ago
If a class has member variables that are pointers, you must ensure that you implement ____.
DedPeter [7]

Answer:

objects

Explanation:

pointer are used for the objects

5 0
2 years ago
A company requires an Ethernet connection from the north end of its office building to the south end. The distance between conne
BlackZzzverrR [31]

Answer:

A company requires an Ethernet connection from the north end of its office building to the south end. The distance between connections is 161 meters and will need to provide speeds of up to 10 Gbps in full duplex mode. Which of the following cable combinations will meet these requirements?

ANSWER: Use multi-mode fiber optic cable

Explanation:

MULTI-MODE FIBER OPTIC CABLE

For Ethernet distances up to 100 meters, the Copper CATX cable will do just fine. In the question, we are dealing with a distance of up to 161 meters, so we need an Ethernet extension. LAN extension over fiber optic cable with media converter can be used to convert the Ethernet cable runs from copper to fiber. Multi-mode fiber has a range of 550 meters for 10/100/1000 Ethernet links.

Multi-mode optical fiber is commonly used for communication over short distances, like within a building or on a campus. They are capable of data rate of up to 100 Gbps, which surpasses the requirements in this question. They are more economical in this case as they are not as expensive a the single-mode optical fiber cable. Fiber optic cable has the advantage of being immune to electromagnetic interferences, spikes, ground loops, and surges. This makes it more suited for this purpose.

7 0
2 years ago
Which of the following commands uses correct syntax for matching the patterns bunk or bank at the end of a line of text?
Alika [10]

Answer:

a. grep 'b[au]nk$' myLine

Explanation:

grep is a command used for searching a specified pattern in a given text.

Our goal is to match the character sequence - bank or bunk at the end of line in a  given line referenced by myLine.

The regular expression for the specified match criterion is:

b[au]nk$

The second character can be either a or u.

$ indicates match at end of line.

So the overall grep command is :

grep 'b[au]nk$' myLine

8 0
2 years ago
Other questions:
  • What is one effective way for employees to keep their skillsets current?
    8·2 answers
  • Whoever helps me with these questions i will help them with the same number of questions in any subject: 1. As the operations ma
    14·1 answer
  • Refer to the exhibit. pc1 issues an arp request because it needs to send a packet to pc3. in this scenario, what will happen nex
    9·1 answer
  • Because of the density of vehicle in urban areas, you should ____.
    8·2 answers
  • With respect to the general classes of computers, a ________ is the most expensive and most powerful kind of computer, which is
    7·1 answer
  • Define a method named roleOf that takes the name of an actor as an argument and returns that actor's role. If the actor is not i
    8·1 answer
  • In Section 8.5.4, we described a situation in which we prevent deadlock by ensuring that all locks are acquired in a certain ord
    11·1 answer
  • When pasting an object which has been copied from a different slide, where on the slide does the object paste, assuming nothing
    15·1 answer
  • Checkpoint 10.43 Write an interface named Nameable that specifies the following methods: _______{ public void setName(String n)
    12·1 answer
  • In Python, parentheses are used in calculations where the order of operations affects the outcome. (5 points)
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!