• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

menu design

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if I wanna create a menu,
should I create tha as a object , or do something like the following(as a funcation)

[ October 22, 2003: Message edited by: brian yuen ]
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're doing this all text mode, run from the command line, no fancy schmancy windows, that's a start.
Let me guess your goal is something like: "Display a menu, get a choice from the user, based on their choice do A or B or C." It might be fancy and include "repeat until user chooses to stop". I'd suggest a couple things as you go from what you typed above:
First, make a real instance of the class. So your main would look more like:

That way the methods that do the real work don't all have to be static, and they can use member variables.
Second, make runAssignment look as much like your assignment as possible.

(Choose better words!) Some people call this "programming by intention" which just means write down what you plan to do and then drill into the details in the called methods. This won't compile until you write the three methods. You can write empty ones that do nothing just to compile or comment them out for a while. Expect them to change a bit as you explore how to code the details.
Hope that helps. Keep posting your progress!
reply
    Bookmark Topic Watch Topic
  • New Topic