Java CW Help

University course discussion for computer science and IT.

Announcements Posted on
Ask me ANYTHING - Andrew O'Neill - Buzzcocks comedian, amateur occultist, vegan... 22-05-2013
IMPORTANT: You must wait until midnight (morning exams)/4.30AM (afternoon exams) to discuss Edexcel exams and until 1pm/6pm the following day for STEP and IB exams. Please read before posting, including for rules for practical and oral exams. 28-04-2013
Sign in to Reply
  1. Covenant Chris's Avatar
    • Junior Member
    • Posts: 71
    Java CW Help
    Hi guys, don't know if this is the place for it, but basically I need some pointers as to how to start my Java coursework. I'll try and explain it as fully as I can without being too over the top.

    I need to make a calculator, which holds a stack of 5 levels, each level can hold a number, a symbol, an algebraic symbol (i.e. 'x') or a combination of all three. The levels of the stack can have various operations, such as swap levels 1 and 2, duplicate level 1, evaluate the contents of level one, insert something into level 1 and shift the contents of all levels up one level (level 5 content is lost) etc. The contents of each level can either be "(empty)" or contain something.

    Here is what the (up side down) stack looks like:

    Level5
    Level4
    Level3
    Level2
    Level1 (top of the stack, where new user inputted values are placed on clicking (enter))

    And the calculator must have a GUI, showing the contents of each level to the user and a text input area.. etc. (I've learnt about 'swing' so I should be OK with that)

    I'd really really appreciate it if you could help me out, just how to start it off. (how many classes, what classes, how to implement the stack etc). I want to use inheritance, polymorphism and decomposition if possible. Any ideas would be great. Thanks again.
    (just the barebones, nothing more)
  2. lex25288's Avatar
    • Exalted Member
    • Posts: 326
    I can't do your coursework for you! However I'll say this: what I'd do is a queue for the levels and iteratively pop them one by one (after doing all the pushing in an initialization phase that is) and add each expression to be evaluated/used by the upper level.
    One piece of advice: don't say I wanna use this and that, if you don't know how you are going to be solving a problem!

    This was posted from The Student Room's Android App on my Galaxy Nexus
  3. {Unregistered}'s Avatar
    • Exalted Member
    • Posts: 273
    Re: Java CW Help
    (Original post by lex25288)
    I can't do your coursework for you! However I'll say this: what I'd do is a queue for the levels and iteratively pop them one by one (after doing all the pushing in an initialization phase that is) and add each expression to be evaluated/used by the upper level.
    One piece of advice: don't say I wanna use this and that, if you don't know how you are going to be solving a problem!

    This was posted from The Student Room's Android App on my Galaxy Nexus
    This is a 3 and a half year old thread.
  4. lex25288's Avatar
    • Exalted Member
    • Posts: 326
    Please tell me you're kidding me... I swear I didn't bother to look how old the thread was....

    This was posted from The Student Room's Android App on my Galaxy Nexus
Sign in to Reply
Share this discussion:  
Article updates
Moderators

We have a brilliant team of more than 60 volunteers looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

Reputation gems:
The Reputation gems seen here indicate how well reputed the user is, red gem indicate negative reputation and green indicates a good rep.
Post rating score:
These scores show if a post has been positively or negatively rated by our members.