Saturday, May 22, 2010

Please help me....... i will do anything(i mean any thing just ask)if u do?

*/my e-mail address is cherryseifu@yahoo.com or cherryseifu@hotmail.com*/





i have this assignment on the next day .the assignment is to write a program in C++,visual studio,


1.


that stores student data of number of students as structure(student ID, student name, age %26amp; CGPA)can insert, sort,delete any of the datas. it is better to put them as a dynamic pointer to delete.


2.and program that enables to add ,subtract or multiply two matrix


the operation are choosen by the user %26amp; the matrix data isgiven by the user.

Please help me....... i will do anything(i mean any thing just ask)if u do?
....anything??....Hmmmmm!
Reply:http://www.freeprogrammingresources.com/...
Reply:For the first one, a doubly linked list is probably the easiest thing to do. Just create a data structure with all of the data you need and pointers to prev and next members. Then as the user adds or deletes records, you can keep them in whatever sorted order you want just by modifying the prev and next pointers of the correct records. You can also dynamically sort the data on any field in the structure. There is a lot of material on the net about linked lists; but this should give you a starting point..


Hope this helps..
Reply:1. U have asked if to use linked list or not. I would say yes. but kkep in mind that you de-allocate the memory when it is done.Otherwise u will be in deep **** cos the pointers use a hell lot of resources. you might also use a deque(double ended queue) with pointer implementation for the same.





2.About the matrix addition use an array and make the life a lot simpler. Accept the values in a loop and read em the same way.





I hope i have made it a lot more simpler that it actually sounds right!!





thanks


Barry
Reply:1: Whats wrong with just using the STL types, no need to be reinventing (and debugging) things like linked lists when you allready have a tried and tested implementation on the box.





2: Looks kind of trivial (if tedious to write), post your code and the error messages and someone will have a look.





Regards, Dan.

survey for cash

No comments:

Post a Comment