Download PROGRAMMING FUNDAMENTALS IN C++

Transcript
25
2) a.
See the denition of determinant of a matrix as below.
Figure 1.7:
Determinant of matrix
Using this information, write and test two functions, named det2() and det3().
The det2() function
should accept the four coecients of a 2 X 2 matrix and return its determinant. The det3() function should
accept the nine coecients of a 3 X 3 matrix and return its determinant by calling det2() to calculate the
required 2 X 2 determinants.
b.
Write and run a C++ program that accepts the nine coecients of a 3 X 3 matrix in one main()
function, passes these coecients to det3() to calculate its determinant and then displays the calculated
determinant.
3) Your professor has asked you to write a C++ program that can be used to determine grades at the end
of the semester. For each student, who is identied by an integer number between 1 and 60, four examination
grades must be kept. Additionally, two nal grade averages must be computed. The rst grade average is