Assignment Question - Please help!
This is the question:
Code the functions: void addCol(), void addRow() and void grow() contained in Matrix.h. Use the file tstMatrix.cpp to test it.
You will need these files:
http://binary.gamer.net.nz/stuff/asn/MATRIX.H
http://binary.gamer.net.nz/stuff/asn/ARRAY.H
http://binary.gamer.net.nz/stuff/asn/tstMatrx.cpp
This is the one question im really stumped on for my assignment, if anyone could suggest the code I need to implement for the three functions id really appreciate it.
[edited by - Aragorn992 on April 14, 2002 10:24:50 PM]
If I could, I would help you I am sorry I can''t I don''t know anything about what you are doing, I am a beginner in C++ ,however I do have something to say. Whoever posted the message above is a complete idiot and needs to stay away from posts if he is going to act like an ass towards others. The idea of these boards is to help others not to make posts saying you don''t want to help them.
"Classes will dull your mind destroy the potential for authentic creativity"
"Classes will dull your mind destroy the potential for authentic creativity"
"Classes will dull your mind destroy the potential for authentic creativity"
quote: Original post by Noxxid
The idea of these boards is to help others not to make posts saying you don''t want to help them.
Yes, but the idea of these forums is not to be a homework resource either. Aragorn992 needs to try to grasp what he is being asked to do and then seek assistance with general concepts. We can''t write your homework for you; you don''t learn that way.
For the record, I''m not saying that either he (Aragorn992) or you (Noxxid) was implying that. But his question is badly malformed. See the Asking Smart Questions link in my sig for pointers on good ways to get information, particularly the "Good and Bad Questions" section. I think you''ll find it very useful.
[ GDNet Start Here | GDNet Search Tool | GDNet FAQ | MS RTFM [MSDN] | SGI STL Docs | Google! | Asking Smart Questions | Internet Acronyms ]
Thanks to Kylotan for the idea!
April 14, 2002 10:54 PM
Wow, you are really anoying.
It is ok to ask for help on an assignment but for crying out loud don''t ask us to do it _for_ you. If you had a specific question then maybe I would take the time to help you, but you just want "the code I [you] need." How pathetic.
By the way, I do know how to do what you ask but I am not going to help you because you don''t want help, you want me to do it for you.
GET A LIFE!!!
Now why don''t you go do your own work instead of coasting though life on the efforts of others.
It is ok to ask for help on an assignment but for crying out loud don''t ask us to do it _for_ you. If you had a specific question then maybe I would take the time to help you, but you just want "the code I [you] need." How pathetic.
By the way, I do know how to do what you ask but I am not going to help you because you don''t want help, you want me to do it for you.
GET A LIFE!!!
Now why don''t you go do your own work instead of coasting though life on the efforts of others.
I completely understand what you are saying about this not being a resource for homework help ,but I just don't think Anonymous should have been so rude about it. I mean couldn't you have just put it in a nicer way?
"Classes will dull your mind destroy the potential for authentic creativity"
[edited by - Noxxid on April 14, 2002 12:08:05 AM]
[edited by - Noxxid on April 14, 2002 12:08:37 AM]
"Classes will dull your mind destroy the potential for authentic creativity"
[edited by - Noxxid on April 14, 2002 12:08:05 AM]
[edited by - Noxxid on April 14, 2002 12:08:37 AM]
"Classes will dull your mind destroy the potential for authentic creativity"
For the record, I disagree with the majority of you flaming this guy, and Oluseyi is right, we can only help you with concept.
Given that...
The concept. I don''t know what grow is supposed to do, so i can''t conceptually help you with that, but to add a row to a matrix, assuming it''s stored in a 2d array, you''d add another row to the array. Adding a column would add one more item at the end of each row of the array. Implementing it isn''t really that hard.
--
WNDCLASSEX Reality;
...
...
Reality.lpfnWndProc=ComputerGames;
...
...
RegisterClassEx(&Reality);
Unable to register Reality...what''s wrong?
---------
Dan Upton
http://0to1.org
http://www20.brinkster.com/draqza
AIM: DigytalSpyder
Given that...
The concept. I don''t know what grow is supposed to do, so i can''t conceptually help you with that, but to add a row to a matrix, assuming it''s stored in a 2d array, you''d add another row to the array. Adding a column would add one more item at the end of each row of the array. Implementing it isn''t really that hard.
--
WNDCLASSEX Reality;
...
...
Reality.lpfnWndProc=ComputerGames;
...
...
RegisterClassEx(&Reality);
Unable to register Reality...what''s wrong?
---------
Dan Upton
http://0to1.org
http://www20.brinkster.com/draqza
AIM: DigytalSpyder
WNDCLASSEX Reality;......Reality.lpfnWndProc=ComputerGames;......RegisterClassEx(&Reality);Unable to register Reality...what's wrong?---------Dan Uptonhttp://0to1.orghttp://www20.brinkster.com/draqza
Ok this is the code ive got for addCol() which doesnt work:
{
if(*some condition to see if an int is given in the addCol () function*)
{
hibnd1=newC; //if an int was given then set hibnd1 to the new value
}
else
{
hibnd1=hibnd1+1; //if an int is not given increment hibnd1 by 1 (i.e.) add 1 column
}
}
Ive tried this and it doesnt work (i.e. the array is still out of range), assistance would be appreciated. If you could show me where im wrong or give me the code just for this function I should be able to apply it to the other two functions.
I am sorry if it seems like I was asking anyone to do the entire question for me. I learn best by seeing other code and using it in more examples, unfortunately I was not given any examples prior to this question and being very in experienced with classes I really had no idea where to start.
{
if(*some condition to see if an int is given in the addCol () function*)
{
hibnd1=newC; //if an int was given then set hibnd1 to the new value
}
else
{
hibnd1=hibnd1+1; //if an int is not given increment hibnd1 by 1 (i.e.) add 1 column
}
}
Ive tried this and it doesnt work (i.e. the array is still out of range), assistance would be appreciated. If you could show me where im wrong or give me the code just for this function I should be able to apply it to the other two functions.
I am sorry if it seems like I was asking anyone to do the entire question for me. I learn best by seeing other code and using it in more examples, unfortunately I was not given any examples prior to this question and being very in experienced with classes I really had no idea where to start.
No offence intended but I am somewhat worried by the code you posted, but you are attempting to learn which is far more that many do. I''m not exactly great at c++ but from what I understand there isn''t really a simple way to extend an array. You are going to have to create a new array of the given size. What you are currently doing is simply changing the variable that you used to create the array, but the length of the array is fixed when you create it, changing the variable after the event will do nothing. Its 3am here and I''m not too sure that makes any sence but hopefully it will set you on the right track.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement