
April 28th, 2011, 03:12 PM
#16
Re: Adding TwoDimensional arrays together
Oh yes I can calculate simultaneous equations by hand. I just found it difficult using a loop to attempt to calculate them with like addition. I just don't understand the whole calculation via a loop with a 2D Array of [3] [4]. I'm a total noob at C++. I've tried an attempt and to me it doesn't seem correct.

April 28th, 2011, 03:19 PM
#17
Re: Adding TwoDimensional arrays together
Please, lay out the sequence of steps you'd use to solve this pair of equations, and we'll go from there.
9 = 4x + 6y
3 = x  10y

April 28th, 2011, 03:42 PM
#18
Re: Adding TwoDimensional arrays together
Originally Posted by TBsparky
Oh yes I can calculate simultaneous equations by hand.
The issue is how you are solving these by hand. If you're solving them by hand using the algrebaic way of doing things, you will be here for months writing a program to simulate what you learned in junior high school. Heck, an expert would be here for weeks writing such a program.
The easiest way that simultaneous equations are solved by computer is to use Gaussian elimination. Did your teacher discuss that? If not, please look that up, as you cannot possibly write a program to solve equations in the "traditional" math book way.
Regards,
Paul McKenzie

April 28th, 2011, 03:45 PM
#19
Re: Adding TwoDimensional arrays together
No she did not discuss the Gaussain method. As far as i know its Solving Simultaneous equations by the use of matrices

April 28th, 2011, 03:53 PM
#20
Re: Adding TwoDimensional arrays together
Originally Posted by TBsparky
by the use of matrices
Key phrase. Do you know what this means? "use of matrices" can mean anything.

April 28th, 2011, 04:36 PM
#21
Re: Adding TwoDimensional arrays together
Originally Posted by TBsparky
No she did not discuss the Gaussain method. As far as i know its Solving Simultaneous equations by the use of matrices
And Guassian method uses matrices.
Again, you cannot write a program within a reasonable time trying to solve equations the way you do by hand using traditional math. The routine you want is called Guassian elimination. Just do a google search, and you will see the routine explained to you.
If your teacher wants you to solve equations as you do with traditional math you learned in school, he or she is playing a very cruel joke on you. You won't, and I bet your entire class won't be able to complete the assignment, or even know where to start if that is really what the teacher is expecting. So I'm assuming your teacher is wanting you to solve the equations using Gaussian elimination (there are other methods, but this is the easiest to implement).
Edit:
Here is a link to a previous topic. Please read:
http://www.codeguru.com/forum/showth...light=gaussian
Regards,
Paul McKenzie
Last edited by Paul McKenzie; April 28th, 2011 at 04:49 PM.

April 29th, 2011, 06:38 AM
#22
Re: Adding TwoDimensional arrays together
Originally Posted by Paul McKenzie
Again, you cannot write a program within a reasonable time trying to solve equations the way you do by hand using traditional math.
You can actually, for this specific case: 2 equations in 2 unknowns. It's simple enough in that case to write out the substitutions explicitly.
Gaussian elimination is the more general solution for handling n equations in n unknowns, of course.
Tags for this Thread
Posting Permissions
 You may not post new threads
 You may not post replies
 You may not post attachments
 You may not edit your posts

Forum Rules

Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.
Featured
