Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
C++ help
Reply
Posted 2006-10-28, 04:10 PM
I have to write a c++ programe that calculate how much paint cans you need to paint a rooms. each rooms have about 12 feet x 10 feet with 8 foot ceilings. each room contains 4foot x 5 foot window and a 3 foot x 7 door. in programe i have to ask the user how much door and windows in room. Can anyone help me
Old
Profile PM WWW Search
osmoses-jones is neither ape nor machine; has so far settled for the in-betweenosmoses-jones is neither ape nor machine; has so far settled for the in-between
 
osmoses-jones
 



 
Reply
Posted 2006-10-28, 04:12 PM in reply to osmoses-jones's post "C++ help"
How big an area can each paint can paint? And is it just the walls you paint?
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny
 



 
Reply
Posted 2006-10-28, 06:41 PM in reply to Lenny's post starting "How big an area can each paint can..."
Seems rather straightforward. What exactly do you seem to be having problems with? And like Lenny said, how much area can the cans paint?
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 
Reply
Posted 2006-10-30, 05:09 PM in reply to Demosthenes's post starting "Seems rather straightforward. What..."
here lab teacher gave us i don't know how to start it up.

Old
Profile PM WWW Search
osmoses-jones is neither ape nor machine; has so far settled for the in-betweenosmoses-jones is neither ape nor machine; has so far settled for the in-between
 
osmoses-jones
 



 
Reply
Posted 2006-10-31, 09:37 AM in reply to osmoses-jones's post starting "here lab teacher gave us i don't know..."
Sure he didn't tell you how big an area each can paints?

It could be that a can paints 175 square feet, or it could be that the second wasn't fully used as both paint 200 square feet.

I don't know C++, but if it was done in VB you'd declare your variables, right? I guess that there is a similar thing done in C++?
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny
 



 
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
 



 
Reply
Posted 2006-11-01, 01:14 PM in reply to Medieval Bob's post starting "Ya your teacher needs to tell you the..."
Also, how is the area of the room 472 if its about 12 x 10 feet in size?
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 
Reply
Posted 2006-11-01, 02:41 PM in reply to Demosthenes's post starting "Also, how is the area of the room 472..."
12 down one side, 10 down the other, 8 high.

2(12 x 8) + 2(10x8) = 352 ---> walls

12x10 = 120 -----> Ceiling

352 + 120 = 472 ----> total paintable area as the floor cannot be painted.
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny
 



 
Reply
Posted 2006-11-01, 03:04 PM in reply to Lenny's post starting "12 down one side, 10 down the other, 8..."
Well hell don't give him all the answers. [/hypocrite]

I was hoping he'd convert my pseudocode, get a ridiculously high number, and then sit down to figure out why it's wrong and how to make it work.
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
 



 
Reply
Posted 2006-11-01, 03:06 PM in reply to Medieval Bob's post starting "Well hell don't give him all the..."
Well, it says Room is 472 square feet in size. Generally square footage of a room is the area of the floor in the room, which can not possibly be 472 square feet.
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 
Reply
Posted 2006-11-01, 03:19 PM in reply to Demosthenes's post starting "Well, it says Room is 472 square feet..."
Sorry, Bob.

---

I know what you mean, MJ. It should really be paintable Surface Area. But who are we to correct a teacher's failings?
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny
 



 
Reply
Posted 2006-11-01, 07:26 PM in reply to Lenny's post starting "Sorry, Bob. --- I know what you..."
ty bob i figure out how now. to find the number of cans i have to divide paintarea by 250. I got my teacher lab yay thank you god i better learn c++ fast or i will be confuse next quarter when i get to work with torque engine.
Old
Profile PM WWW Search
osmoses-jones is neither ape nor machine; has so far settled for the in-betweenosmoses-jones is neither ape nor machine; has so far settled for the in-between
 
osmoses-jones
 



 
Reply
Posted 2006-11-02, 03:23 PM in reply to osmoses-jones's post starting "ty bob i figure out how now. to find..."
What are the major differences between C++ and VB?

If you know how to do everything in VB, and know what the same functions would be in C++, then would you be able to write C++ programs using a VB one as a base?
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny
 



 
Reply
Posted 2006-11-02, 04:17 PM in reply to Lenny's post starting "What are the major differences between..."
Lenny said:
What are the major differences between C++ and VB?

If you know how to do everything in VB, and know what the same functions would be in C++, then would you be able to write C++ programs using a VB one as a base?
You could use the same functions in a C++ program as you could in a VB program via DLL's, I believe. Syntactically, they're a bit different, so simply knowing VB would not allow you to code in C++, but I don't think it would be too difficult to pick up on it. I believe you can write functions in C++, put them in DLLs and then use those functions on a VB program. As for simply continuing a VB program in C++, I wouldn't be surprised if it is possible, although I have no earthly idea how to do it. I don't know VB, though, so don't quote me on any of this. I've only dabbled around with it.
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 
Reply
Posted 2006-11-02, 06:56 PM in reply to Demosthenes's post starting "You could use the same functions in a..."
VB is missing a good bit of the functionality of C++ is because of its simplicity. You can do anything that you can do in VB in C++ and vice versa, but typically complex programs aren't written in VB. VB isn't very well adapted to object oriented programming. And finally, C++ is much faster.
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
 



 
Reply
Posted 2006-11-03, 10:31 AM in reply to Medieval Bob's post starting "VB is missing a good bit of the..."
I see.

So how easy is C++ to learn:

a) With no prior experience with any programming language?
b) With experience with things like VB?
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny
 



 
Reply
Posted 2006-11-03, 01:18 PM in reply to Medieval Bob's post starting "VB is missing a good bit of the..."
Medieval Bob said:
You can do anything that you can do in VB in C++ and vice versa,
Can you do system level programming and such with VB?

a.) Lenny, C was the first language I picked up on, which is not so dissimilar from C++. It was not difficult at all.

b.) It would help considerably.
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 



 
Reply
Posted 2006-11-03, 01:40 PM in reply to Demosthenes's post starting "Can you do system level programming and..."
Rightyho.

Methinks that once I know my way around VB like the back of my hand, I'll have a crack at C++.

Last edited by Lenny; 2006-11-03 at 02:04 PM.
Old
Profile PM WWW Search
Lenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basicsLenny simplifies with no grasp of the basics
 
 
Lenny
 



 
Reply
Posted 2006-11-03, 11:43 PM in reply to Demosthenes's post starting "Can you do system level programming and..."
If you can write it in C++, you can write it in VB. Your implementation may have to be different, but you can get all the same functionality.
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
 



 
Reply
Posted 2006-11-03, 11:46 PM in reply to Medieval Bob's post starting "If you can write it in C++, you can..."
Medieval Bob said:
If you can write it in C++, you can write it in VB. Your implementation may have to be different, but you can get all the same functionality.
I thought that pointers and such are restricted in VB. For instance, if I wanted to write directly to the video buffer, how would I accomplish this in VB? I don't know though, I don't know VB at all, I just heard that pointers were severely limited in VB.

Last edited by Demosthenes; 2006-11-03 at 11:53 PM.
Old
Profile PM WWW Search
Demosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to beDemosthenes seldom sees opportunities until they cease to be
 
Demosthenes
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 12:42 PM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.