![]() |
|
#1
|
|||
|
|||
How many gallons of paintHello guys!
I want to program something that tells me how many gallons of paint I need and what the total cost of the painting . I gotta say I am new to this, I hope the question dosen't seem that silly CPP / C++ / C Code:
I hope everything is right. But I do have a question about the following code.. CPP / C++ / C Code:
I know it cant be just x and y now. But if I did total_area for x and y it wouldn't calculate it right. I think I have enough variables.. I don't know.. I kinda don't know how do do this part. I believe I need to more variables for this..? Thank you!! |
|||
|
#2
|
||||
|
||||
Re: question about codeQuote:
but to the "question about the following code"... Calculating perimeter is: P = (2*L + 2*W). Then the 'total_area' = P*height. A sample run (after corrections) looks like this: Code:
Post another reply if you have more questions. Also check this article, where it mentions how to include the ceiling's area (if painting an interior room, of course), plus this tidbit: Quote:
Just a few other side notes: 1. Why the global variables? All those should be inside main(). 2. No need for a pause() function. cin.get() can accomplish the same thing. 3. Not sure what the purpose of the line with: + 0.9999 ?? HTH. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#3
|
|||
|
|||
Re: question about codeHello!
Yes, thank you! So I need to declare one more variable? In your case P. I also noticed the other errors when I ran it. Sorry. |
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trouble integrating console code into GUI | Barman007 | Java Forum | 18 | 15-May-2008 14:05 |
| How to sort random access file? | wmmccoy0910 | C Programming Language | 12 | 04-Sep-2006 04:40 |
| Here it is again! 35% - 40% off For Life! | my-e-space | Web Hosting Advertisements & Offers | 0 | 20-Apr-2006 15:48 |
| Guidelines for posting requests for help - UPDATED! | WaltP | C Programming Language | 0 | 21-Apr-2005 03:44 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The