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
Gnom [1K]
3 years ago
7

Output each floating-point value with two digits after the decimal point, which can be achieved as follows:

Computers and Technology
1 answer:
sdas [7]3 years ago
3 0

Answer:

The modified program in Python is as follows:

import math

paint_colors = {'red': 35,'blue': 25,'green': 23}

wall_height = int(input('Enter wall height (feet):\n'))

wall_width = int(input('Enter wall width (feet):\n'))

area = wall_height*wall_width

print('Wall area:',area,'square feet')

paint_needed = area/350.0

print('Paint needed: {:.2f} gallons'.format(paint_needed))

print('Cans needed:',round(paint_needed),'can(s)')

color = input("Choose a color to paint the wall: ")

print("Cost of purchasing", color, "paint: $",paint_colors[color])

Explanation:

The italicized are given from the question [unchanged]

<em>import math</em>

<em> paint_colors = {'red': 35,'blue': 25,'green': 23} </em>

<em>wall_height = int(input('Enter wall height (feet):\n')) </em>

This gets input for width

wall_width = int(input('Enter wall width (feet):\n'))

Calculate the wall area

area = wall_height*wall_width

Print the calculated wall area

print('Wall area:',area,'square feet')

Calculate the amount of paint needed

paint_needed = area/350.0

Print the amount of paint needed to 2 decimal places

print('Paint needed: {:.2f} gallons'.format(paint_needed))

Print the amount of can needed to nearest integer

print('Cans needed:',round(paint_needed),'can(s)')

Prompt user for color of paint [here, we assume the user input is correct]

color = input("Choose a color to paint the wall: ")

Prints the corresponding amount for the color

print("Cost of purchasing", color, "paint: $",paint_colors[color])

You might be interested in
What should be the very last function performed in the lab before you leave? Bid the instructor farewell wipe your hands on a to
34kurt

Answer:

Wash your hands with soap and water.

Explanation:

This answer comes with common sense, because before you leave, you MUST wash your hands, it's hygiene measure.

7 0
3 years ago
1. Paying attention to the trends that might impact your future career is called
amm1812
The answer is A futurecasting.
8 0
4 years ago
Read 2 more answers
Three things you will do when driving?
Leviafan [203]
Wear Your Seatbelt 
Ignite Car
Observe other Drivers
3 0
3 years ago
Read 2 more answers
why is it important to include keywords that represent each of the essential concepts that make up your research question when y
SpyIntel [72]

Answer:

hi

Explanation: hi

7 0
3 years ago
Consider a smart array that automatically expands on demand. (Like the java.util.ArrayList.) It starts with some given initial c
elena-14-01-66 [18.8K]

Answer:

Total unit of work required is 1019 units.

Solution:

As per the question:

Initial capacity = 100

On each expansion 50 is added to the present capacity.

Now,

Work done required in addition  of 1000 items = 1000 unit

No. of times there is a need for the allocation of a new Array is given by:

n = \frac{1000 - 100}{50} = 18

We know that:

On addition of 101th element it expands from 100 to 150

On addition of 151st element it expands from 150 to 200 and so on till

On addition of 951st element it expands from 950 to 1000

Now,

For an array of 100 size - 1 for initial allocation.

Therefore, total work done is  given by:

W = 1000 + \frac{1000 - 100}{50} + 1 = 1019\ units

4 0
4 years ago
Other questions:
  • When you pass an array to a method, the method receives ______.
    7·1 answer
  • What are the latest technology in 2014
    11·1 answer
  • Which type of cell references are locked and NOT automatically updated when it’s copied
    8·1 answer
  • Which kind of journal gives submissions to outside scientists to read and comment upon?
    9·1 answer
  • Which visual aid would help a group of veterinary students study a dog's anatomy?
    14·1 answer
  • What is the first thing you should do before constructing a window in the IDE?
    14·1 answer
  • Anybody good with Microsoft excel? I need help with this class.
    9·2 answers
  • To carry computer data over the long haul, wans need to have a(n) ________ in multiple towns and cities.
    10·1 answer
  • Which of the following is not a SQL*Loader file?
    11·1 answer
  • In client server network, there is no central server //// true or false​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!