pointerquiz

# pointerquiz - / / / / / / / / / / / / / / / / / / / / / /...

This preview shows pages 1–2. Sign up to view the full content.

Page 1 // CS 31 Quiz 13 // February 28, 2007 // John A. Rohr // // This program solves a system of two equations in two unknowns. // // The equations are the following: // // ax + by = c // dx + ey = f // // Analysis: // // Using determinants, the denominator of the solution will be // // denom = a * e - b * d // // If the denominator is zero, the solution is not unique. // If the denominator is not zero, the solution is as follows: // // x = (c * e - b * f) / denom // y = (a * f - c * d) / denom #include <iostream> using namespace std int main() { double mat[2][3] // Equation matrix double *pDenom // Denominator pointer double *pX // First variable pointer double *pY // Second varaible pointer int *pE // Equation index pointer int *pT // Term index pointer // Display a title and a blank line cout << "2 x 2 EQUATION SOLVER" << endl << endl // Allocate the variables pDenom = new double pX = new double pY = new double pE = new int pT = new int // If any allocation was unsuccessful

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/12/2009 for the course CS 31 taught by Professor Melkanoff during the Winter '00 term at UCLA.

### Page1 / 3

pointerquiz - / / / / / / / / / / / / / / / / / / / / / /...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online