+ 1

how to write the code can go back to the beginning? java calculator..plz help!

I was making a calculator but I could not figure out how to write the code that can exit to the menu.. I need your help guys.. also, how to show the result.. here is my code so far and my scenario also in this link. https://code.sololearn.com/cWCGrtbzH4tf

27th Apr 2017, 7:43 PM
Kurt Cobain
Kurt Cobain - avatar
1 Answer
+ 12
Not working at the code playground, but simply add a while loop around your code in the main method - this is a quick and dirty approach ^^ Better approach: Search about the state machine pattern on Google, it will help you.
27th Apr 2017, 8:00 PM
Tashi N
Tashi N - avatar