Mail Archives: djgpp/1999/01/22/12:19:13
This is a multi-part message in MIME format.
--------------E474D587F92D05DA35F4F0E7
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
hi there,
I just started to learn C++ programming coz it was a module of my
course of study. I know that my questions maybe a bit out of the list, but I
hoped that someone would be kind enough to help me.
1. Can anyone recommend any book on C++ which you have read and think that it is
good??? coz my school only provide notes for the basic, but i want to go further
in programming.
2. I has a mini-project which i need to pass up in two week time, but i has no
ideas what the project want me to do??? There are a lot of term such as
algorithm, recursion and a lot more terms which i have not learn before. Just
hoping that someone will explain what the project want me to do? (attach
project.txt)
please help me, coz i only learn the basic of C++ to array only.
please do a word wrap as it will make reading more easier.
Thank you all.
--
==========================
| õ¿õ | õ¿õ | õ¿õ | õ¿õ |
Email: cdman AT mbox2 DOT singnet DOT com DOT sg
Eight => Galaxynet => #milkbar
UIN: 6930385
==========================
--------------E474D587F92D05DA35F4F0E7
Content-Type: text/plain; charset=us-ascii; name="Project.txt"
Content-Disposition: inline; filename="Project.txt"
Content-Transfer-Encoding: 7bit
PROJECT TITLE:
==============
Development of Software Routines to find the 4th Order Determinant.
PROJECT DESCRIPTION:
====================
A 2nd order determinant,
| a11 a12 |
| a21 a22 |
can be calculated using the formula:
| a11 a12 |
| a21 a22 | = a11 * a22 - a12 * a22
To calculate the 3rd order determinant, each element of a selected row multiples the minor of the element. The result are added or subtracted together in an alternating pattern
The minor of an element aij is determinant obtained by removing row i and column j.
As an example, the 3rd order determinant,
| a11 a12 a13 |
| a21 a22 a23 |
| a31 a32 a33 |
can be calculated as
| a11 a12 a13 |
| a21 a22 a23 |
| a31 a32 a33 |
= a11 * minor(a11) - a12 * minor(a12) + a13 * minor(a13)
or
| a11 a12 a13 |
| a21 a22 a23 |
| a31 a32 a33 |
= a11 * | a22 a23 | - a12 * | a21 a23 | + a13 * | a21 a22 |
| a32 a33 | | a31 a33 | | a31 a32 |
row 1, row 1, row 1,
column 1 column 2 column 3
removed removed removed
PROJECT REQUIREMENT:
====================
You are required to produce a set of functions, with the appropriate arguments, to calculate until the 4th order determinant. In order to achieve that you have to write functions to find the 2nd order determinant, the 3rd order determinant and to extract the array elements of a minor.
(Alternative algorithm is to develop the 2nd order determinant and the 3rd order minor. This means incorporating the last two functions above as one).
You are required to come up with the input function to enable the data entry of the elements of the determinant. Design the function such that it can be used for data entry into any order of determinant.
Your program should contain the main() function whereby the various function are called and the result vertifed. This is used to test your functions.
PROJECT ENHANCEMENT:
====================
Instead of using merely a test stub as suggested in (b), develop a complete program to implement Cramer's rule to solve simultaneous linear equations of up to 4 unknowns. Remember also that there are simultaneous equations that do not have unique solutions. Your program has to test for this. Find out the condition where no unique solution can be found. You must also develop another function to replace the appropriate columns of the determinant with the constants of your equations.
The solution by Cramer's rule to the linear system
a11x1 + a12x2 + a13x3 = b1
a21x1 + a22x2 + a23x3 = b2
a31x1 + a32x2 + a33x3 = b3
is in the form
1 | b1 a12 a13 |
x1 = - det | b2 a22 a23 |
D | b3 a32 a33 |
1 | a11 b1 a13 |
x2 = - det | a21 b2 a23 |
D | a31 b3 a33 |
1 | a11 a12 b1 |
x3 = - det | a21 a22 b2 |
D | a31 a32 b3 |
where
| a11 a12 a13 |
D = det | a12 a22 a23 |
| a13 a32 a33 |
Another enhancement you may want to consider is to write a generic function to find the determinant of ANY order. To achieve this you will need to use recursion, which is outside the scope of our curriculum but it is not a very difficult technique to use. With this, you can solve any systems of linear equations using determinants. A very useful routine to have when you have to solve the parameters of a network of electrical circuits using mesh technique.
-=[ FINISH ]=-
--------------E474D587F92D05DA35F4F0E7--
- Raw text -