Grade 11 C++ Programming

Hi I am a Grade 11 student who needs help on a program for my computer science class. Here is the question:

You work for a painting company. Your job is to calculate the amount of paint needed for every contract assigned to the company. This time, you need to paint an outside wall. The dimensions of the wall are 5 X 7m. The window is a circle with the radius of 1m. Write a program that would calculate the following:
The amount of paint needed knowing that you need 1 gallon per 10 square meters. The amount of time to complete the job knowing that it takes 1 hour per 10 square meters to prepare the surface, 5 minute per square meter to pant it and 5 minute per square meter to clean up the area.
Did you start it? What's your question?
I don't know how to start it. Do I use class like public and private?
Ugh..You don't really need a class for this. You could use basic arithmetic.


The wall is 5x7m, the circle has a radius of 1m.

Then you are given 1 gallon = 10 sq meters.

Takes 1 hour to prepare 10 sq meters of surface (sanding probably)
Takes 5 minutes to paint each sq meter and takes 5 minutes to clean up after painting each sq meter.


It wants you to calculate the amount of paint and time required.


To find the area of a rectangle it would be Base * Height = 5 * 7 = 35 sq meters
To find the area of a circle it would be 2 * pi * radius = 1 * 2 * 3.14159 = 6.28318 sq meters

So you need to paint 41.28318 sq meters so you need 5 gallons.

To find the time it would be Time = totalArea / 10 * 60 + 2 * totalArea * 5 = 41.28318 / 10 * 60 + 2 * 41.28318 * 5 = 4.128318 * 60 + 10 * 41.28318 = 4.128318 * 60 + 412.8318 = 247.69908 + 412.8318 = 660.53088 minutes = 11.008848 hours.


Though you don't really need to calculate this by hand you need to create a program to calculate this.

I just created this assignment in about 5 minutes, though I won't provide the code because that wouldn't really help you with the assignment. So it will probably take you 20-30 minutes.


The key things to keep in mind.

std::cout << for writing.
std::cin >> for reading.
double for floating point
int for integers
* for multiply
+ for addition
/ for divide
= for assignment
formulas I mentioned earlier for area
Note that the area of the circle is a window and should not be painted. That area of the window should probably be subtracted from the area of the wall, not added to it.
Last edited on
Good call Doug Nit sure what I was thinking last night
Area of circle is pi*radius*radius afaik
Man I can't believe giblit got that wrong and I missed it. I must have been asleep, too.
Oops ya I accidentally put circumference
Topic archived. No new replies allowed.