| CS150 -- Lab 3: Cramer's Rule |
|
|
OverviewIn this lab, you will write a program to solve two simultaneous linear equations using Cramer's rule. AcknowledgementThis laboratory assignment is based on an exercise from Program Development and Design Using C++, 2nd ed. by Gary Bronson. ProcedureEngineers often need to solve simultaneous linear equations. Most engineers don't derive a lot of satisfaction from solving the equations by hand, so they would prefer to have a calculator or computer solve the equations for them. Cramer's rule is a technique for solving simultaneous linear equations. For the following set of two linear equations with two unknowns: a1 X + b1 Y
= c1 where a1, a2, b1, b2 c1, and c2 are constants and X and Y are the unknowns, Cramer's rule states that: X = (c1 b2
- c2 b1) /
(a1 b2
- a2 b1) Design, write, and test a computer program that prompts the user for six constants (a1, a2, b1, b2, c1, and c2) and displays the solution (X and Y) to the two linear equations represented by the input data. Lab Report (due beginning of week 5 lab)The lab report should be self-contained. That is, it should be possible for someone to understand what you did and why without seeing anything other than your report. Your report should include:
Your report should be typed, and as with any report you submit, correct spelling and grammar are required. Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. Your grade will depend on quality of design and clarity of the code and documentation, as well as whether your program produces the correct results. If you have any questions, consult the instructor. |
| Office: CC-27C, Phone: 277-7339 |
| Last Updated: September 10, 2000 © 2000 Dr. Christopher C. Taylor |