Skip to main content
added 115 characters in body
Source Link
user33306
user33306

Another thing to consider. Instead of sending the output of your methods directly to the console, make them return a string. This way a person using your class can output it to a console or a form or a webpage whatever.

You might want to consider having the menu display and the switch block, that processes the input, in the same method. If you decide to change a menu item all your code for that is in one place.

If you want the ability to use a foreach loop with your petlist you'll have to implement an enumerator as well.

Another thing to consider. Instead of sending the output of your methods directly to the console, make them return a string. This way a person using your class can output it to a console or a form or a webpage whatever.

You might want to consider having the menu display and the switch block, that processes the input, in the same method. If you decide to change a menu item all your code for that is in one place.

Another thing to consider. Instead of sending the output of your methods directly to the console, make them return a string. This way a person using your class can output it to a console or a form or a webpage whatever.

You might want to consider having the menu display and the switch block, that processes the input, in the same method. If you decide to change a menu item all your code for that is in one place.

If you want the ability to use a foreach loop with your petlist you'll have to implement an enumerator as well.

added 199 characters in body
Source Link
user33306
user33306

Another thing to consider. Instead of sending the output of your methods directly to the console, make them return a string. This way a person using your class can output it to a console or a form or a webpage whatever.

I think you'll find that without implementing and index operator you'll haveYou might want to accessconsider having the list with petlist.pets[index]menu display and the switch block, that processes the input, in the same method. If you decide to change a menu item all your code for that is in one place.

Another thing to consider. Instead of sending the output of your methods directly to the console, make them return a string. This way a person using your class can output it to a console or a form or a webpage whatever.

I think you'll find that without implementing and index operator you'll have to access the list with petlist.pets[index]

Another thing to consider. Instead of sending the output of your methods directly to the console, make them return a string. This way a person using your class can output it to a console or a form or a webpage whatever.

You might want to consider having the menu display and the switch block, that processes the input, in the same method. If you decide to change a menu item all your code for that is in one place.

Source Link
user33306
user33306

Another thing to consider. Instead of sending the output of your methods directly to the console, make them return a string. This way a person using your class can output it to a console or a form or a webpage whatever.

I think you'll find that without implementing and index operator you'll have to access the list with petlist.pets[index]