Please help me to convert a simple C++ program into an object-oriented one.

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2007
Posts: 10
Reputation: zekesteer is an unknown quantity at this point 
Solved Threads: 0
zekesteer zekesteer is offline Offline
Newbie Poster

Please help me to convert a simple C++ program into an object-oriented one.

 
0
  #1
Dec 30th, 2007
Hi all,

I’ve been given told to convert a standard C++ program into an object-oriented one, using the principals of polymorphism, encapsulation and inheritance. Our lecturer covered all three principals in one 45 minute slot. I’m completely stuck and would be grateful for any help.

The standard C++ program accepts data values and filter values from the user. It then multiplies these values together using a simple algorithm and prints the output to the screen. The standard program is shown below.

I haven’t made much of a start as I’m unsure how to allocate the classes. I’ve allocated one class to the TheFilter structure with its associated data and functions, and another to the TheData structure.

I hate to admit defeat, but I’ve never programmed using an object-oriented approach and I’ve only been studying C++ for a couple of months. Please help!

Thanks in advance.

Zeke

Standard C++ program follows:

  1. // Purpose
  2. // A program to demonstrate the application of a simple digital filter
  3. //
  4. // Overview
  5. // A sequence of data items and digital filter values need to be entered by the
  6. // user. The application of the filter to the data involves a simple convolution
  7. // operation. The filtered data are stored separately.
  8. //
  9. // Example
  10. // before filtering:
  11. // data_in = [0 1 3 6 3 1 0]
  12. // filter = [-0.5 1 -0.5]
  13. // after filtering:
  14. // data_out = [-0.5 -0.5 3 -0.5 -0.5]
  15. // where
  16. // data_out[0]=data_in[0]*filter[0]+data_in[1]*filter[1]+data_in[2]*filter[2]
  17. // data_out[1]=data_in[1]*filter[0]+data_in[2]*filter[1]+data_in[3]*filter[2]
  18. // data_out[2]=data_in[2]*filter[0]+data_in[3]*filter[1]+data_in[4]*filter[2]
  19. // data_out[3]=data_in[3]*filter[0]+data_in[4]*filter[1]+data_in[5]*filter[2]
  20. // data_out[4]=data_in[4]*filter[0]+data_in[5]*filter[1]+data_in[6]*filter[2]
  21. //
  22. // The program checks the following
  23. // 1. The data and filter values must have been entered before the filter is
  24. // applied
  25. // 2. The filter is not applied if the number of filter values is greater than
  26. // the number of input data values
  27. // 3. The data and filter values must have been entered and the filter applied
  28. // before the filtered data can be displayed
  29. #include <iostream>
  30. using namespace std;
  31.  
  32. // the data values and the filter
  33. struct TheFilter {
  34. double* Values; // the filter values
  35. unsigned long Length; // number of filter values
  36. bool Valid; // true if the filter values have been Valid by the user
  37. };
  38.  
  39. struct TheData {
  40. double* Values; // holds the data to be filtered
  41. unsigned long Length; // number of data values
  42. bool Valid; // true if the data values have been Valid by the user
  43. };
  44.  
  45. // function return values
  46. enum {OK,FILTER_TOO_LONG};
  47.  
  48. // function prototypes
  49. void EnterData(TheData&);
  50. void EnterFilter(TheFilter&);
  51. int ApplyFilter(TheFilter, TheData, TheData&);
  52. void DisplayData(TheFilter, TheData, TheData);
  53.  
  54. // Control the principal operations of the program
  55. // Arguments: None
  56. // Returns: 0 on completion
  57. int main()
  58. {
  59. // define the filter and its initial values
  60. TheFilter Filter = {0,0,false};
  61.  
  62. // define the original data and its initial values
  63. TheData OriginalData = {0,0,false};
  64.  
  65. // define the filtered data and its initial values
  66. TheData FilteredData = {0,0,false};
  67.  
  68. char UserInput;
  69.  
  70. // loop until the user wishes to exit
  71. while (1) {
  72.  
  73. // show the menu of options
  74. cout << endl;
  75. cout << "Filter Menu" << endl;
  76. cout << "-----------" << endl;
  77. cout << "1. Enter data for filtering" << endl;
  78. cout << "2. Enter filter values" << endl;
  79. cout << "3. Apply filter" << endl;
  80. cout << "4. Display filtered data" << endl;
  81. cout << "5. Exit from the program" << endl << endl;
  82.  
  83. // get the user's choice
  84. cout << "Enter your option: ";
  85. cin >> UserInput;
  86. cout << endl;
  87.  
  88. // act on the user's input
  89. switch(UserInput) {
  90. case '1':
  91. EnterData(OriginalData);
  92. FilteredData.Valid = false;
  93. break;
  94.  
  95. case '2':
  96. EnterFilter(Filter);
  97. FilteredData.Valid = false;
  98. break;
  99.  
  100. case '3':
  101. if (Filter.Valid == true && OriginalData.Valid == true &&
  102. FilteredData.Valid == false) {
  103. if (ApplyFilter(Filter,OriginalData,FilteredData) == FILTER_TOO_LONG) {
  104. cout << "The filter must not be longer than the data" << endl;
  105. }
  106. else {
  107. FilteredData.Valid = true;
  108. cout << "Filter applied" << endl;
  109. }
  110. }
  111. break;
  112.  
  113. case '4':
  114. if (Filter.Valid == true && OriginalData.Valid == true &&
  115. FilteredData.Valid == true) {
  116. DisplayData(Filter,OriginalData,FilteredData);
  117. }
  118. else {
  119. cout << "Data have not yet been filtered" << endl;
  120. }
  121. break;
  122.  
  123. case '5':
  124. delete [] Filter.Values;
  125. delete [] OriginalData.Values;
  126. delete [] FilteredData.Values;
  127. return 0;
  128. break;
  129.  
  130. default:
  131. cout << "Invalid entry" << endl << endl;
  132. break;
  133. }
  134. }
  135. }
  136.  
  137. // Allow the user to enter the data to be filtered
  138. // Arguments:
  139. // (1) the structure containing the input data
  140. // Returns: nothing
  141. //
  142. void EnterData(TheData& GetData)
  143. {
  144. // initialize the data structure that holds the data to be filtered, including getting
  145. // the number of data values from the user
  146. delete [] GetData.Values;
  147. cout << "How many data values do you wish to enter: ";
  148. cin >> GetData.Length;
  149. GetData.Valid = true;
  150.  
  151. // allocate memory to the data
  152. GetData.Values = new double[GetData.Length];
  153. if (GetData.Values == 0) {
  154. cout << "Unable to allocate sufficient memory" << endl;
  155. exit(1);
  156. }
  157.  
  158. // obtain all of the data values
  159. cout << endl;
  160. cout << "Enter the data values" << endl;
  161. cout << "---------------------" << endl;
  162. for (unsigned long CountData = 0; CountData < GetData.Length; CountData++) {
  163. cout << "Enter value " << CountData+1 << ": ";
  164. cin >> GetData.Values[CountData];
  165. }
  166. }
  167.  
  168. // Allow the user to enter the filter values
  169. // Arguments:
  170. // (1) the structure of the filter to be defined
  171. // Returns: nothing
  172. //
  173. void EnterFilter(TheFilter& GetFilter)
  174. {
  175. // initialize the data structure that holds the filter, including getting the number of
  176. // filter values from the user
  177. delete [] GetFilter.Values;
  178. cout << "How many data values do you wish to enter: ";
  179. cin >> GetFilter.Length;
  180. GetFilter.Valid = true;
  181.  
  182. // allocate memory to the filter values
  183. GetFilter.Values = new double[GetFilter.Length];
  184. if (GetFilter.Values == 0) {
  185. cout << "Unable to allocate sufficient memory" << endl;
  186. exit(1);
  187. }
  188.  
  189. // obtain all of the filter values
  190. cout << endl;
  191. cout << "Enter the filter values" << endl;
  192. cout << "-----------------------" << endl;
  193. for (unsigned long CountData = 0; CountData < GetFilter.Length; CountData++) {
  194. cout << "Enter value " << CountData+1 << ": ";
  195. cin >> GetFilter.Values[CountData];
  196. }
  197. }
  198.  
  199. // Apply the filter to the input data and store in the filtered data structure
  200. // Arguments:
  201. // (1) the structure of the filter to be applied
  202. // (2) the structure containing the data to be filtered
  203. // (3) the structure to hold the filtered data
  204. // Returns: OK - if the filter is applied
  205. // FILTER_TOO_LONG - the filter is longer than the data
  206. //
  207. int ApplyFilter(TheFilter Filter, TheData DataIn, TheData& DataOut)
  208. {
  209. // return an error if the filter is longer than the data
  210. if (Filter.Length > DataIn.Length) return FILTER_TOO_LONG;
  211.  
  212. // initialize the data structure that holds the filtered data
  213. delete [] DataOut.Values;
  214. DataOut.Length = DataIn.Length - Filter.Length + 1;
  215.  
  216. // get memory for the filtered data
  217. DataOut.Values = new double[DataOut.Length];
  218. if (DataOut.Values == 0) {
  219. cout << "Unable to allocate sufficient memory" << endl;
  220. exit(1);
  221. }
  222.  
  223. // apply the filter to the data
  224. for (unsigned long CountData = 0; CountData < DataOut.Length; CountData++) {
  225. DataOut.Values[CountData] = 0.0;
  226. for (unsigned long CountFilter = 0; CountFilter<Filter.Length; CountFilter++) {
  227. DataOut.Values[CountData] += DataIn.Values[CountData+CountFilter] *
  228. Filter.Values[CountFilter];
  229. }
  230. }
  231.  
  232. return OK;
  233. }
  234.  
  235.  
  236. // Display input data, filter values and output data
  237. // Arguments:
  238. // (1) the structure of the filter to be applied
  239. // (2) the structure containing the data to be filtered
  240. // (3) the structure that holds the filtered data
  241. // Returns: nothing
  242. //
  243. void DisplayData(TheFilter Filter, TheData DataIn, TheData DataOut)
  244. {
  245. // display all of the input data values
  246. cout << endl;
  247. cout << "The input data values" << endl;
  248. cout << "---------------------" << endl;
  249. cout << "[ ";
  250. for (unsigned long CountData = 0; CountData < DataIn.Length; CountData++) {
  251. cout << DataIn.Values[CountData] << " ";
  252. }
  253. cout << "]" << endl;
  254.  
  255. // display all of the filter values
  256. cout << endl;
  257. cout << "The filter values" << endl;
  258. cout << "-----------------" << endl;
  259. cout << "[ ";
  260. for (unsigned long CountData = 0; CountData < Filter.Length; CountData++) {
  261. cout << Filter.Values[CountData] << " ";
  262. }
  263. cout << "]" << endl;
  264.  
  265. // display all of the data output values
  266. cout << endl;
  267. cout << "The data output values" << endl;
  268. cout << "----------------------" << endl;
  269. cout << "[ ";
  270. for (unsigned long CountData = 0; CountData < DataOut.Length; CountData++) {
  271. cout << DataOut.Values[CountData] << " ";
  272. }
  273. cout << "]" << endl;
  274. }
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,951
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Please help me to convert a simple C++ program into an object-oriented one.

 
0
  #2
Dec 30th, 2007
The difference between an procedural and an object-oriented approach is how you bind the data and the functions that do something to it together.

Right now you have a very good structure. You have structs that hold the data, and functions that operate on specific data.

What you need to do is turn those structs into classes, and make the procedures and functions that operate on the structs into member functions (or methods) of the class.

Keep in mind that the member functions should generally work only on its own data. So, for example, you have the functions EnterData() and EnterFilter(). The first would make a good method of your TheData class, and the second would make a good method in your TheFilter class.

Your DisplayData() function operates on a number of different structures, but not any of them at the same time. Each of your classes, then, should have a DisplayData() method, which only displays it's own data.

You will have to decide how to use the filter class and the data classes all together. You could:
  1. Make a method of the TheFilter class take a TheData object and return a new TheData object.
  2. Make a method of the TheData class take a TheFilter object and filter its own data.
  3. etc.

You will still have to create three separate variables, but instead of assigning them initial (or default) values in main(), have the class constructor initialize the data.


Personally, I would also recommend that you use a vector instead of a newed array, but that is not essential to the assignment and you can save it for later (or not at all).


Hope this helps.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 10
Reputation: zekesteer is an unknown quantity at this point 
Solved Threads: 0
zekesteer zekesteer is offline Offline
Newbie Poster

Re: Please help me to convert a simple C++ program into an object-oriented one.

 
0
  #3
Dec 30th, 2007
Duoas,

Thank you for your helpful reply!

It's such a relief that you've advised me to change the TheData and TheFilter structs to classes, as I had done this already - although I had no confidence that what I was doing was correct.

The areas that were really confusing me were the ApplyFilter() and the DisplayData() functions, and how to interface these with the TheFilter and TheData classes that I had assigned.

On your advice, I'll place separate DisplayData() member functions in the TheData and TheFilter class definitions. I can see your point about the different ways to implement the ApplyFilter() function.

Will you be available on the forum to help me further with this assignment, just in case any problems arise?

Once again, thanks so much for your help and your time.

Zeke
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,951
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Please help me to convert a simple C++ program into an object-oriented one.

 
0
  #4
Dec 30th, 2007
Glad to be of help. I check in fairly regularly, but if I'm not here someone else will surely help. There are a fair number of knowledgeable people here who are always willing to help.

Have fun!
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,671
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 261
Lerner Lerner is offline Offline
Posting Virtuoso

Re: Please help me to convert a simple C++ program into an object-oriented one.

 
1
  #5
Dec 31st, 2007
zekester:

Here's some additional thoughts. If you find them useful, fine, if not, so be it.

Just so you know (I'm sure Duoas already does) there is no need to change the struct declarations into class declarations. In C++ the only distinction between classes and structs is that data members are declare with private access in classes and public access in structs. Some people still retain the feel of C style structs withing their programs by using structs in C++ only if the class doesn't contain member functions, but that isn't necessary.

If you are going to declare memory dynamically for a data member of a class, it is probably a good idea to have each class allocate and delete memory used rather than trying to do it within the program. This is frequently, though not always, done in the constructor and destructor respectively, in addition to the assignment and copy operators as needed. Of course, if you don't have to do your own memory handling, then don't.

To demonstrate inheritance in your program you could declare an abstract base class called Form (or some other name) which has the same data members as TheData and TheFilter with a pure virtual member function called displayData. The inherited classes could also hold unique member functions to do tasks unique to their existence. This may be a bit strained intellectually because TheData and TheFilter classes aren't related like Dogs and Cats are both Animals, but reality is frequently distorted for educational purposes. It's up to you, of course.

An additional twist, primarily for educational purposes again, might be to have a working class called FilterProgram which contains members from both of the original classes as needed, rather than declaring them from witin main(), and has all the menus, etc within it which can be called using appropriate member functions, etc. Doing it this way it is sometimes possible to write the program like this:
  1. #include "FilterProgram"
  2. int main()
  3. {
  4. FilterProgram program;
  5. program.run();
  6. }
This type of program is called a driver program because it is really just a way to access the necessary header files, where all the work is actually done. One advantage of this style is that individual files are readily available for reuse in other programs as desired, rather than having to rewrite the classes, structs, etc in each program as the need arises. This style also provides additional experience writing modular (OOP?) programs by compartmentalizing everything with the class declarations, even if it isn't necessarily the most straightforward program to read (you end up pulling up the linked files one by one to find information about each of the included classes, etc, since it's not all in one spot to allow you to track through the information needed by scrolling up and down the screen without flipping from file to file).
Last edited by Lerner; Dec 31st, 2007 at 12:27 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 10
Reputation: zekesteer is an unknown quantity at this point 
Solved Threads: 0
zekesteer zekesteer is offline Offline
Newbie Poster

Re: Please help me to convert a simple C++ program into an object-oriented one.

 
0
  #6
Dec 31st, 2007
Hi Lerner,

Thanks so much for your post!

The task stipulates explicitly that we have to use classes and that all data members must be private. I appreciate that this complicates the program unnecessarily but the lecturer is trying to test my grasp of classes rather than structs.

We briefly covered constructors and destructors, copy constructors, overloading operators, friend functions and the 'this' pointer, so I expect that we have to use all of these tools to achieve full marks.

We haven't covered abstract classes or virtual member functions but I can see the merit in your suggestion of creating a new class which is able to access data from TheData and TheFilter, and to manipulate that data using its own set of member functions, especially for the ApplyFilter() and DisplayData() functions (if my understanding is wrong, please correct me!).

Duoas suggested that I have separate DisplayData() functions in my TheData and TheFilter classes, and that I make the ApplyFilter() function a member function of either class. Which approach would be better?

Your "additional twist" is incredibly helpful as the task stipulates that the main function can create the first object only. I presume that this approach could be used to compartmentalise the code into separate functions as well?

Thanks once again. I'd be lost without the help I've received on this forum.

Zeke
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,671
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 261
Lerner Lerner is offline Offline
Posting Virtuoso

Re: Please help me to convert a simple C++ program into an object-oriented one.

 
0
  #7
Dec 31st, 2007
The base class, what I called Form, doesn't have to be abstract if that's not something you've discussed. It could be a routine base class. The advantage of being abstract is that it couldn't be instantiated since that doesn't make any sense (but straining reality is common in examples used for teaching purposes, so that's not unexpected). Again, structs can have private members as well as public (or protected for that matter). Here's a skeletal version of the inheritance heirachy using structs to demonstrate my point.
  1. struct Form
  2. {
  3. private:
  4. double age;
  5. string name;
  6. };
  7.  
  8. struct TheData : public Form
  9. {
  10. void displayData();
  11. };
  12.  
  13. struct TheFilter : public Form
  14. {
  15. void displayData();
  16. };
Now both TheData and TheFilter objects will contain a double and a string which have private access and their own displayData() functions which have public access, just like you can have in a class. struct declarations are just like classes except in the default access of the members and the terms are often used interchangeably. If your instructor uses the term class in the narrow sense, then by all means declare each user defined type as a class. But you should know that in C++ there's nothing you can do with a class you can't do with a struct if you want. (NB, the code snippet above is far from an adequate type declaration. It was posted only as an example of how you'd use keywords in declaring a struct to get it to behave exactly as a class would.)

I think Duos' suggestions were right on target given as far as he went without knowing the full restrictions of the assignment, and I just made a lucky guess. If you have a class called FilterProgram, as I suggested as a possibility, then ApplyFilter() would seemingly fit best as member function of the FilterProgram class and not in either the TheData or TheFilter classes.

When you're done with the program all of the stand alone functions in the original post would end up as member functions of one class or another.
Last edited by Lerner; Dec 31st, 2007 at 3:21 pm.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,951
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Please help me to convert a simple C++ program into an object-oriented one.

 
0
  #8
Dec 31st, 2007
I'm not sure I understand one part of your assignment. You stated that you are only allowed to directly instantiate one object. This makes little sense to me, as the program requires two objects to combine to produce a third.
FilteredData = OriginalData + Filter
(where '+' means 'apply the filter', of course).

This train of thought is validated by the fact that both the OrignalData and the Filter require user input.

While Lerner's suggestion about shared inheritance is good, given the actual structure of the classes, this is actually just a happy convenience. In reality, the filter and the data are only related because the filter modifies the data in some way. That is to say, the filter and the data are separate things, both conceptually and implementationally. (That one operates upon the other is not causal, just as their similarity in structure is not causal.)

In summation: how exactly does your professor expect you to create only one object at the start?

Thought 1:
Make FilterProgram a function, which takes as argument a TheData object (the one you create in main()), creates a TheFilter object, applies the filter, and returns to main() a filtered TheData object.

This of course will spread user I/O out between main() and FilterProgram()... (Indirectly, of course, as actual I/O should occur as you have it: in your member functions).

Thought 2:
(Is a really bad idea, so I won't share it.)


hmm...

(BTW. If my thinking has confused you on any specific point, just ask.)
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,671
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 261
Lerner Lerner is offline Offline
Posting Virtuoso

Re: Please help me to convert a simple C++ program into an object-oriented one.

 
0
  #9
Dec 31st, 2007
I totally agree with Duoas that the inheritance scenario I described is extremely contrived and the ONLY reason I would consider doing it would be to prove I could do inheritance and polymorphism in the program as presented.

I disagree with Duoas as to the flow of the program. With appropriate fleshing out of the repsective user defined types I think something like this would work fine, directly declaring just a single object in main():
  1. struct TheData
  2. {
  3. void EnterData();
  4. void display();
  5. };
  6.  
  7. struct TheFilter
  8. {
  9. void EnterFilter();
  10. void display();
  11. };
  12.  
  13. struct FilterProgram
  14. {
  15. TheData data;
  16. TheFilter filter;
  17. TheData filteredData;
  18.  
  19. void run();
  20. void applyFilter();
  21. void displayFilteredData();
  22. };
  23.  
  24. int main()
  25. {
  26. FilterProgram program;
  27. program.run();
  28. }
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,951
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Please help me to convert a simple C++ program into an object-oriented one.

 
0
  #10
Dec 31st, 2007
I think you missed my point.

First off, I expressed no disapproval of deriving TheData and TheFilter from a common ancestor. What I said was that they shouldn't be intimately familiar.

Secondly, I don't think you should be introducing new structures into the assignment. Particularly as the FilterProgram is, as you have suggested it, simply a stand-in for main(). The assignment could be just as easily, and more simply, written without it:
  1. struct TheData
  2. {...};
  3.  
  4. struct TheFilter
  5. {...};
  6.  
  7. int main()
  8. {
  9. TheData data;
  10. TheFilter filter;
  11. TheData filteredData;
  12. ...
  13. }
Your solution sidesteps the problem of instantiating a single object in a way the teacher will not accept! Remember, keep it simple, and don't shuffle creation of things off into another function just to avoid doing it in main(). Avoiding main() is not a good enough reason to do that.

My question remains valid: how are you to initialize both the data and filter objects before filtering? And how are you to display the filtered data when done?

If your program is to behave like the original:
  1. enter data
  2. enter filter
  3. apply filter to original data --> filtered data
  4. display original, filter, and filtered data.
  5. quit.
then there must be some consideration given to the following:
  1. how are the filter and the filtered data to be displayed alongside the original data?
  2. how are the second piece of primary data (which I presume would be the filter) and the secondary data (the filtered data) to be generated and stored?

I have several related ideas as to how I would do it, very simply, but I expect zekesteer to think about it and present his own thoughts before I suggest anything further. (One possibility is that the strict structure of the original menu is not part of the assignment, just the way that zekesteer implemented it the first time through?)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC