SKELETON_4 - CS 31: Introduction to Computer Science I: / /...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 31: Introduction to Computer Science I: Winter 2010: Project 4 Skeleton Page 1 // UCLA Winter 2010 // CS 31 Project 4 Skeleton Code // John A. Rohr // February 20, 2010 // // // This program solves a system of simultaneous linear equations. // // If the system has a unique solution, the program finds the solution. // If the system does not have a unique solution, the program reports that. // // The program can handle up to ten equations with ten variables. // // All input is read from the file File4.In. // All output is written to cout and the file File4.Out. // If either of the files cannot be opened, the program terminates. #include <iostream> #include <fstream> #include <iomanip> using namespace std; // ************************************************************************** // * * // * GLOBAL CONSTANTS * // * * // ************************************************************************** const char INFILE_NAME[] = "File4.In"; const char OUTFILE_NAME[] = "File4.Out"; const int MAX_EQNS = 10; // Maximum number of equations const int PRECISION = 4; // Precision of double output const int OUTPUT_WIDTH = 10; // Width of double output const int TERMS_PER_LINE = 3; // Number of terms per output line // ************************************************************************** // * * // * GLOBAL VARIABLES * // * * // ************************************************************************** ifstream fin; // Input file ofstream fout; // Output file
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS 31: Introduction to Computer Science I: Winter 2010: Project 4 Skeleton Page 2 // ************************************************************************** // * * // * MAIN PROGRAM * // * * // ************************************************************************** int main() { // Function declarations bool initialize(); // Initialize the program bool getInput // Get the input equations (double mat[][MAX_EQNS+1], // Matrix of equations int &numeq); // Number of equations void displayEquations // Display the equations (double mat[][MAX_EQNS+1], // Matrix of equations int numeq); // Number of equations bool solveEquations // Solve the system of equations (double mat[][MAX_EQNS+1], // Matrix of equations int numeq); // Number of equations
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

SKELETON_4 - CS 31: Introduction to Computer Science I: / /...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online