Thread: C++ help
View Single Post
 
Reply
Posted 2006-10-31, 09:50 AM in reply to Lenny's post starting "Sure he didn't tell you how big an area..."
Ya your teacher needs to tell you the coverage of a paint can. By that information, a can of paint could cover 349 square feet of room.

Damn I wish I was back at this level... *sigh*

Anyhow, for your program, you'll have something like this. (This is just pseudocode; don't copy it straight, because it won't work)

int totalarea
int doorarea
int windowarea
int paintablearea
int numdoors
int numwindows
int numcans

totalarea = 8 * 10 * 12

cout << how many doors?
cin >> numdoors
doorarea = numdoors * 3 * 7

cout << how many windows?
cin >> numwindows
windowarea = numwindows * 4 * 5

paintablearea = totalarea - (doorarea + windowarea)

numcans = ceil(paintablearea / WHATEVER A CAN PAINTS)
cout << The number of cans you'll need is << numcans
D3V said:
This message is hidden because D3V is on your ignore list.
What is it they say about silence being golden?
Old
Profile PM WWW Search
Medieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHzMedieval Bob enjoys the static noises of ten television sets simultaneously tuned to 412.84 MHz
 
 
Medieval Bob