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
How can people make sure they are using credit cards responsibly
Ray Of Light [21]
Set a buget based on monthly income
8 0
3 years ago
Read 2 more answers
In C complete the following:
Crazy boy [7]

Answer:

#include <stdio.h>

void printValues ( unsigned char *ptr, int count) // count is no of cells

{

 for(int i=0; i<count; i++) {

   printf("%d ", ptr[i]);

 }

}

int main ( )

{

 unsigned char data[ ] = { 9, 8, 7, 5, 3, 2, 1} ;

 printValues( data, sizeof(data)/sizeof(data[0]) );

}

Explanation:

Remember that the sizeof() mechanism fails if a pointer to the data is passed to a function. That's why the count variable is needed in the first place.

3 0
3 years ago
How does the author of let bindi have the limelight persuade readers to consider the importance of wildlife conservation
kvasek [131]

Answer:

The answer is animal extinction.

Explanation:

Bind is considered to be an animal ambassador. The death of her father made her want to dedicate her career to animal conservation. She takes action, through business and performing to help conservation causes.

4 0
3 years ago
Read 2 more answers
What is it called when memory that is stored on chips located near the mother board
Paul [167]
This is referred to as Random Access Memory (RAM), and is used when the computer needs to recall tasks quickly, as opposed to more slowly when it uses the hard drive.
5 0
3 years ago
Read 2 more answers
Let's assume that you wrote a query that has the following four clauses: SELECT, FROM, WHERE, ORDER BY. The order in which the f
morpeh [17]

Answer:

"From, where, select ,order by" is the correct answer for the above question.

Explanation:

  • When a user creates a query in comparison of "SELECT, FROM, WHERE ORDER BY", then the query will execute in the "From, where, select, order by" order.
  • Firstly form clause will execute because it holds the name of the table which defined the address of the data which needs to fetch.
  • Then the where clause will execute which is used to filter the data. It states the correct location of the data in the table.
  • Then the select clause is executed because it works to fetch the data and gives the output to the user.
  • Then the order by clause is executed because it states the data in ascending or descending order.
6 0
3 years ago
Other questions:
  • Assuming deq is a deque object, the expression deq.push_front(elem) deletes the first element from deq.
    10·1 answer
  • What special precautions should you take when detailing a steel-framed building to avoid excessive conduction of heat through th
    9·1 answer
  • Which WAN technology is designed to work with a variety of commonly used layer-2 protocols and is sometimes called a layer-2.5 t
    15·1 answer
  • Which type of account typically has very high liquidity, low or no interest, and low minimum balance?
    5·2 answers
  • Please help! 40 points + Brainliest!
    8·1 answer
  • Identify an advantage of the software as a service (SaaS) approach in public cloud computing. Group of answer choices The user h
    5·1 answer
  • Any action that causes harm to your computer is called a
    15·1 answer
  • What do you do when ur grounded from all electronics and can't go outside and have t clean all day
    10·1 answer
  • Can you plz type down a word.
    11·2 answers
  • Write a short essay about the best rotary-wing aircraft ever. It must be a specific aircraft and consist of three paragraphs. In
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!