Two Plus Two Older Archives

Two Plus Two Older Archives (http://archives2.twoplustwo.com/index.php)
-   Computer Technical Help (http://archives2.twoplustwo.com/forumdisplay.php?f=46)
-   -   C++ Shape Program Help (http://archives2.twoplustwo.com/showthread.php?t=366847)

mscags 10-27-2005 07:05 PM

C++ Shape Program Help
 
Alright so I have this program due tomorrow and have no idea how to start it!! Click here and go to homework 3 http://www.cs.missouristate.edu/~liu/csc125/index.htm Any help would be greatly appreciated. Thanks

Mike

cgwahl 10-27-2005 08:33 PM

Re: C++ Shape Program Help
 
I would just use dynamic multi-dimensional arrays based on the parameters entered by the user...

mscags 10-27-2005 08:38 PM

Re: C++ Shape Program Help
 
English please lol I'm in an intro class and know nothing about C++ Thanks

StevieG 10-27-2005 08:50 PM

Re: C++ Shape Program Help
 
[ QUOTE ]
English please lol I'm in an intro class and know nothing about C++ Thanks

[/ QUOTE ]

This is Java, so you're going to have to port it to C++ yourself:

<font class="small">Code:</font><hr /><pre>
while (student.takingClassForCredit() ) {
try {
student.DoYourOwnWork();
} catch (slackerException se) {
if (se.Type == slackerException.gettingPissyAtPeopleWhoDoTryToHel p) {
student.FOAD();
}
}
}
</pre><hr />

OrcaDK 10-27-2005 08:51 PM

Re: C++ Shape Program Help
 
[ QUOTE ]
I would just use dynamic multi-dimensional arrays based on the parameters entered by the user...

[/ QUOTE ]

Why make is so advanced? All of those tasks can be solved using for loops, besides the menu coding of course.

cgwahl 10-27-2005 08:53 PM

Re: C++ Shape Program Help
 
[ QUOTE ]
English please lol I'm in an intro class and know nothing about C++ Thanks

[/ QUOTE ]


Basically arrays created on the fly. Your book should show this...otherwise just do a few searches online (your greatest resource for programming anyhow).

For instance the rectangle...say the user wants one that is 4x8

I create 2-dimensional array [4][8] (really it'd be [x][y] or is it (x)(y)?...I can't remember)

Then you'll just have to create the algorithm to give you the output to the array

$$$$$$$$
$oooooo$
$oooooo$
$$$$$$$$

The o's is whitespace.


As for the other 2, just look for the pattern...pretty easy to pick out. Once you figure the one out for the triangle, you'll then have the one for the diamond.

cgwahl 10-27-2005 08:54 PM

Re: C++ Shape Program Help
 
[ QUOTE ]
[ QUOTE ]
I would just use dynamic multi-dimensional arrays based on the parameters entered by the user...

[/ QUOTE ]

Why make is so advanced? All of those tasks can be solved using for loops, besides the menu coding of course.

[/ QUOTE ]


True

I just like arrays. heh

mscags 10-27-2005 11:05 PM

Re: C++ Shape Program Help
 
Thanks for the help. I think I can make it work that way.

Mike


All times are GMT -4. The time now is 06:54 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.