![]() |
Storing numbers and recalling numbers ?
Storing numbers and recalling Question
Lets say you've entered a value displays the output i.e String s; float A; double Number; s=TextFieldValueA.getText(); A=Integer.parseInt(s); Number= (double)Math.round(A); s=String.valueOf(Number); txtNumber.setText(s); now when you select store on the menu it stores the number "ValueOf(Number)" and TextField A just like when you click store buttton on a calcutor M+ and M- to recall that number and to recall the Stored Values to be displayed on the textfields Number and A when recall is selected this can be done in Pascal when programming your calculator like the TI 84 Silver i.e 1-(sto)-> A A= 1 rcl A, A=1 ive tried the stack method of push pop etc no success in achieving if theres a simple method your help would be appreciated on this one Thanks >>>>>>>> |
Quote:
|
example ive used the node method trial
Code:
class Node{Code:
public String toString() {stack method StackClass stack1=new StackClass(); try { stack1.push(new IntElement(1); got sophisticated so left it out i need just to make it simple thats all M+ (memory store button is clicked) stores the values M- (Memory recall button is clicked ) recalls the values as mentioned earlier when the recall button is clicked it sets the stored numbers back on the textField A and Number using setText("") method its possible with a calculator like microsoft calculator as you know why not java if not any thing is possible :( Your help im really stuck on this one i know it is straight forward any suggestions??:confused::confused: |
Aren't you overcomplicating things? IMHO all you need is a single instance variable to hold the contents of the _memory_
Code:
class Calculator { |
Splendid God bless
i can now work my way into a complex solution really appreciate thanks just one question why cant i give a reputation round here i keep getting this message neeed to spread reputation first before.... so and so very helpful |
| All times are GMT +1. The time now is 02:58 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.