12.9k views
2 votes
350 square feet requires 1 gallon of paint. assign gallons_paint with the amount of paint required for wall_area. sample output for the given program:

User Sleepster
by
5.9k points

1 Answer

6 votes

Given,

350 square feet requires 1 gallon of paint

To assign gallons of paint with the amount of paint required for wall area.

Since 350 square feet requires 1 gallon of paint

350/350 square feet will require 1/350 gallon of paint

1 square feet requires 1/350 gallon of paint

That is, for each square meter area of wall, 1/350 gallon of paint is required

Each square meter area of wall requires 1/350 gallon of paint

Therefore, x square meter area of wall requires x/350 gallon of paint

Mathematically,

If x is the area of wall in square meters,

And y is the amount of paint required in gallons

y = x/350

For instance, for 250 square meter area of wall

x = 350

y = x/350

y = 250/350

y = 0.714285714286

Amount of paint required = 0.714285714286 gallons

User Dariush Jafari
by
5.9k points