Java CW Help
University course discussion for computer science and IT.
-
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)
-
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 -
Re: Java CW HelpThis is a 3 and a half year old thread.(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