d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > New Coder > Progress Thread
Prev12
Add Reply New Topic New Poll
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Mar 7 2014 01:38pm
Quote (Minkomonster @ Mar 7 2014 03:23pm)
He's suggesting the use of a switch statement to handle general menu selections. At it's core, it's not a bad design (setting aside the fact that it breaks OOP design), and with tweaks it could be applied to the OPs implementation to handle user input. But for what reason? It's a single user input statement that checks for a single value to continue looping. It's a prime example where s while loop is satisfactory. Implementing the switch statement just adds useless fluff.


I thought he was trying to handle all divisor inputs via a switch statement, which is just ridiculous lol. Reasoning for that was OP only had one user input for menu options, so why use an integer based menu?

Guess I over looked it.
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Mar 7 2014 02:29pm
Quote (AbDuCt @ Mar 7 2014 02:38pm)
I thought he was trying to handle all divisor inputs via a switch statement, which is just ridiculous lol. Reasoning for that was OP only had one user input for menu options, so why use an integer based menu?

Guess I over looked it.


My interpretation was that was just an example on if the user is inputing integers. The same can be done with char, string, etc.
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll