molly8213 / calculator-app

0 stars 0 forks source link

Great submission but store the entire operation when keeping the history of previous calculations #1

Open KapsonLabs opened 2 years ago

KapsonLabs commented 2 years ago

Hey @molly8213 Your submission is great and i am very impressed. But for the part of the history, please only store the entire operation and not only a single number. You might have to use 2 data structures to achieve this. One to store the details of the computation and the other to store the result.

You can clear the data structure with the computations and populate it with the result once the user clicks one of the operations buttons again. e.g. Iteration 1. computation_data = 1+2 answer_data = 3

Iteration 2 The answer becomes the first element in the computation data structure when the user clicks one of the arithmetic operation buttons computation_data = 3+(any other number) answer_data = empty

molly8213 commented 2 years ago

Thank you for the correction Will work on it