Thread: Matrix Help

  1. #16
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Why, do you want to close this thread?

    [edit]Your urgency is not ours. Spamming the boards will decrease the likelihood of a reasonable response. Bumping threads ain't gonna help ya neither.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  2. #17
    Registered User
    Join Date
    Mar 2008
    Posts
    15
    TRust me I'm in lab right now trying to work on it, but the TA only gives vague answers. Well thanks for the help Can I have a title?

  3. #18
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Slacker?

    C'mon, with instructions like this you can't even come up with a couple skeletal functions?
    Please use the following function names: SetMatrixA( ), DisplayMatrixA( ), AddMatrixBtoA( ) to perform the matrix addition, MultiplyMatrixBtoA( ) for matrix multiplication, TransposeMatrixA(), and InvertMatrixA().
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  4. #19
    Registered User
    Join Date
    Mar 2008
    Posts
    15
    Code:
    void SetMatrix(double A[5][5], char z)
            {
            printf("Please enter matrix %c:\n", z);
    
            for(i=0; i<=rowA; i++)
            {
              for(j=0; j<=columnA; j++)
              {
              printf("Row %d, Column %d: ", i+1, j+1);
              scanf("%lf", &A[i][j]);
              }
            }

    what does char z do in this statement

  5. #20
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I'm very close to closing this thread since it's a blatant attempt by a lazy student to get someone else to do their homework.

  6. #21
    Registered User
    Join Date
    Mar 2008
    Posts
    15
    Quote Originally Posted by Bubba View Post
    I'm very close to closing this thread since it's a blatant attempt by a lazy student to get someone else to do their homework.
    Guy with the cat icon is helping me out. I gave the portion on my code, but I don't completely understand what char z is. Is it a variable?

  7. #22
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Quote Originally Posted by HelpmeMark View Post
    Code:
    void SetMatrix(double A[5][5], char z)
            {
            printf("Please enter matrix %c:\n", z);
    
            for(i=0; i<=rowA; i++)
            {
              for(j=0; j<=columnA; j++)
              {
              printf("Row %d, Column %d: ", i+1, j+1);
              scanf("%lf", &A[i][j]);
              }
            }

    what does char z do in this statement
    It appears to be used to indicate what the user is entering.

    On the for loops, one typically wants to do < rather than <=.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  8. #23
    Registered User
    Join Date
    Mar 2008
    Posts
    15
    Help

  9. #24
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    [edit]
    Help
    Don't bump threads! It's just going to make people less willing to respond. [/edit]

    Quote Originally Posted by HelpmeMark View Post
    Guy with the cat icon is helping me out. I gave the portion on my code, but I don't completely understand what char z is. Is it a variable?
    It is a parameter to the function SetMatrix(). A parameter is a way to pass information in (and sometimes out) of a function. Yes, it is a type of variable.

    Here's a simple example:
    Code:
    #include <iostream>
    
    void function(int parameter);
    
    int main() {
        int value = 3;
        function(value);
    
        return 0;
    }
    
    void function(int parameter) {
        std::cout << parameter << std::endl;
    }
    [edit=2] I suggest you have a quick look over these tutorials, especially the "function" one. cprogramming.com/tutorial.html [/edit]
    Last edited by dwks; 03-05-2008 at 06:17 PM.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  10. #25
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    So you are asked to code this and don't understand what a char is? Either your teacher/prof is going way too fast or you are not listening. I find it hard to believe you would have been given this type of assignment and yet know as little as you do about the language.

    This is why I'm hesistant to help.

  11. #26
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Here's another example of how functions work. It might help you with your homework.

  12. #27
    uint64_t...think positive xuftugulus's Avatar
    Join Date
    Feb 2008
    Location
    Pacem
    Posts
    355
    Help
    The best help i can offer is my sincere regret that time unfortunately passes.
    Code:
    ...
        goto johny_walker_red_label;
    johny_walker_blue_label: exit(-149$);
    johny_walker_red_label : exit( -22$);
    A typical example of ...cheap programming practices.

  13. #28
    Registered User
    Join Date
    Mar 2008
    Posts
    8
    Thanks For Nothing

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C - access violation
    By uber in forum C Programming
    Replies: 2
    Last Post: 07-08-2009, 01:30 PM
  2. Gauss-Jordan Matrix Inversion in C++
    By Max_Power82 in forum C++ Programming
    Replies: 3
    Last Post: 12-03-2006, 08:31 PM
  3. Matrix and vector operations on computers
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 05-11-2004, 06:36 AM
  4. Matrix Reloaded Questions (SPOILERS_
    By Xei in forum A Brief History of Cprogramming.com
    Replies: 73
    Last Post: 10-19-2003, 02:21 PM