Need help with a program please

Hey guys, i'd appreciate any help with this program, it's not a very difficult one.

Project objectives:
1. User interface design and implementation.
2. Basic matrix operations.
3. Multi-dimension array manipulation.
4. Functions.

Project design:

(1) Your program will read in a list of matrices from an input file. Each matrix starts with one line that has character matrix name, and integer for the number of rows, and an integer from the numbers of the columns, followed by values of elements of matrix. For example, the input of the matrix A is

A 2 3
2 5 8
1 3 6
For this project, the input file contains 5 matrices and each matrix has no more than 10 rows and no more than 10 columns.


(2) Your program will display the following user interface:
Please select from the following matrix operations:
1. Transpose matrix
2. Calculate determinant (not needed)
3. Add matrices
4. Multiply matrices
5. Quit
(3) If user selects option 1 or 2, your program will prompt the user to select a matrix by name. If user selects option 3 or 4, your program will prompt the user to select a matrix by name twice. If an invalid matrix name is entered, you will display invalid matrix selection! and ask the user the select a matrix name again.
(4) After the program reads in the operation and valid matrix name(s), it will perform the operation, print out the result, go back to step (2). Not all operations will be possible for all the matrices selected. If and operation cannot be performed on the matrix/matrices selected, you will print the appropriate error message and return to step (2).
(5) When the user enters option (6), you will print Thank you for using the matrix operation program and exit the program.

Comments

  • : Hey guys, i'd appreciate any help with this program, it's not a very difficult one.
    :
    : Project objectives:
    : 1. User interface design and implementation.
    : 2. Basic matrix operations.
    : 3. Multi-dimension array manipulation.
    : 4. Functions.
    :
    : Project design:
    :
    : (1) Your program will read in a list of matrices from an input file. Each matrix starts with one line that has character matrix name, and integer for the number of rows, and an integer from the numbers of the columns, followed by values of elements of matrix. For example, the input of the matrix A is
    :
    : A 2 3
    : 2 5 8
    : 1 3 6
    : For this project, the input file contains 5 matrices and each matrix has no more than 10 rows and no more than 10 columns.
    :
    :
    : (2) Your program will display the following user interface:
    : Please select from the following matrix operations:
    : 1. Transpose matrix
    : 2. Calculate determinant (not needed)
    : 3. Add matrices
    : 4. Multiply matrices
    : 5. Quit
    : (3) If user selects option 1 or 2, your program will prompt the user to select a matrix by name. If user selects option 3 or 4, your program will prompt the user to select a matrix by name twice. If an invalid matrix name is entered, you will display invalid matrix selection! and ask the user the select a matrix name again.
    : (4) After the program reads in the operation and valid matrix name(s), it will perform the operation, print out the result, go back to step (2). Not all operations will be possible for all the matrices selected. If and operation cannot be performed on the matrix/matrices selected, you will print the appropriate error message and return to step (2).
    : (5) When the user enters option (6), you will print Thank you for using the matrix operation program and exit the program.
    :
    Here's a bit to start you off:
    [code]
    int main()
    {
    // TODO: Read in set of matrices
    do
    {
    // TODO: display current set of matrices

    // TODO: prompt user with choices
    //1. Transpose matrix
    //2. Calculate determinant (not needed)
    //3. Add matrices
    //4. Multiply matrices
    //5. Quit

    // TODO: get selection from user

    // handle selection
    switch(selection)
    {
    case 1:
    DoTranspose();
    break;
    case 2:
    DoDeterminant();
    break;
    case 3:
    DoAddMatrices();
    break;
    case 4:
    DoMultiplyMatrices();
    break;
    case 5:
    cout << Thank you for using the matrix operation program
    << endl;
    exit(0);
    }
    }
    }

    // TODO: Add functions as noted above to handle the matrix transforms
    [/code]Good luck!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion