reset password
Author Message
jpascua
Posts: 197
Posted 22:26 Jan 27, 2015 |

So I'm trying to implement the main function but I noticed that the user can select whatever option they want despite having created a set or not. 

How exactly is this supposed to work? Are we supposed to have a set that's readily made (perhaps the default set) just in case the user doesn't select the options create one?

303496263
Posts: 68
Posted 22:49 Jan 27, 2015 |

According to the instructions, you do not create any set unless the user chooses to. 

All you need to do initially is display a menu and wait for the user input. If the user does not choose anything from the menu, then let it be so. The program has lots of time and can wait forever unless there's a power outage lol

jpascua
Posts: 197
Posted 22:51 Jan 27, 2015 |

Yes, but the user can go straight to selecting option 7 - 15 before even selecting options 1, 2, 3, 4, 5, or 6 (to create a set).

Last edited by jpascua at 22:52 Jan 27, 2015.
kscasado
Posts: 19
Posted 22:57 Jan 27, 2015 |

I don't think there is anything saying that you cant have a default set that you initialize in case they don't create one. From what i understand there are two routes,

1.You can either create an initial Set that you use in case they select a Menu Item that does not create one.

2. You can display that they need to create a set if they choose an option that requires a set and a set has not been created. 

 

As long as you are able to test all of your class functions through using the menu I don't think it matters which way it is implemented. 

 

303496263
Posts: 68
Posted 23:01 Jan 27, 2015 |

That's practically true, but I am sure that's not what Keenan is looking for. 

If you really want to overcome that issue, you could actually check to see if a set(or two) is available to be used when the user chooses menu items 7-15. One way or the other, you would have to ask the user which set(s) they wanna use when they choose menu item 7-15.

jpascua
Posts: 197
Posted 00:06 Jan 28, 2015 |

Nevermind, I think I found a way.

Thanks for the replies. :)

Last edited by jpascua at 00:17 Jan 28, 2015.
kknaur
Posts: 540
Posted 07:15 Jan 28, 2015 |

For this homework you can assume I will be sure to create the sets first.  You are correct however in that you should consider cases like this and take measures to prevent your user from potentially crashing the program by not choosing menu options in the correct order. 

One thing I like to do is give my program to a friend or relative who does not have a CS background and ask them to play around with the program.  Sometimes your average user will try things we wouldn't normally think of because we get so used to a certain way of seeing our programs.  This is a really good testing strategy.  Also it tests whether or not someone clearly understands what your program is doing / asking for.