SKELETON_4

SKELETON_4 - CS 31 Introduction to Computer Science I UCLA...

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

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

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/08/2010 for the course COM SCI 31 taught by Professor Kinsey during the Spring '98 term at UCLA.

Page1 / 10

SKELETON_4 - CS 31 Introduction to Computer Science I UCLA...

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

View Full Document
Ask a homework question - tutors are online