How to create history function in calculator ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 28

How to create history function in calculator ?

I want to add history function in calculator means when user press the history icon then it should be show the history of calculation but I don't know how to do it... can anyone help me plz give the answer with solid code 🙏

7th Jun 2021, 1:07 PM
☆𝑺𝑴𝑷☆
☆𝑺𝑴𝑷☆ - avatar
19 Answers
9th Jun 2021, 3:10 AM
☆𝑺𝑴𝑷☆
☆𝑺𝑴𝑷☆ - avatar
+ 11
save every state in an array. here is a working solution. ask me in code comment if you didn't got anything. https://code.sololearn.com/WC6ata80i03P/?ref=app
8th Jun 2021, 5:47 AM
Prashanth Kumar
Prashanth Kumar - avatar
+ 10
I think you don't understand what is my problem....I will take help from someone else and thanks for your response 😊 🙏
7th Jun 2021, 3:29 PM
☆𝑺𝑴𝑷☆
☆𝑺𝑴𝑷☆ - avatar
+ 10
I know that... And I also know the JavaScript , not too much but yes I know . And I got a solution just wait for my next code 🙂
8th Jun 2021, 1:58 AM
☆𝑺𝑴𝑷☆
☆𝑺𝑴𝑷☆ - avatar
+ 10
Prashanth Kumar [back again] Thank you.... but it is not show history properly as I want... But I got a solution. I will show you in my next code how I want the history.
8th Jun 2021, 5:58 AM
☆𝑺𝑴𝑷☆
☆𝑺𝑴𝑷☆ - avatar
+ 8
HTML
7th Jun 2021, 1:26 PM
☆𝑺𝑴𝑷☆
☆𝑺𝑴𝑷☆ - avatar
+ 8
Yes means with the help of JavaScript and CSS
7th Jun 2021, 1:29 PM
☆𝑺𝑴𝑷☆
☆𝑺𝑴𝑷☆ - avatar
+ 7
Safura Patel thats nice
8th Jun 2021, 5:59 AM
Prashanth Kumar
Prashanth Kumar - avatar
+ 7
Safura Patel nice 👌🏻
9th Jun 2021, 8:29 AM
Prashanth Kumar
Prashanth Kumar - avatar
9th Jun 2021, 8:32 AM
Tharul Nejana
Tharul Nejana - avatar
28th Nov 2021, 11:31 AM
☆𝑺𝑴𝑷☆
☆𝑺𝑴𝑷☆ - avatar
+ 4
https://code.sololearn.com/WMNEo80RYFvD/?ref=app
8th Jun 2021, 7:54 AM
Tharul Nejana
Tharul Nejana - avatar
+ 2
You want to create History in Web page Than you Must Know JavaScript
7th Jun 2021, 4:54 PM
Rohit Singh
Rohit Singh - avatar
+ 1
Then you have to first convert the whole calculation into a string and use an array of a stack
7th Jun 2021, 1:30 PM
Eashan Morajkar
Eashan Morajkar - avatar
+ 1
Well I don't think so you can make a history because you are not doing the calculation
7th Jun 2021, 3:09 PM
Eashan Morajkar
Eashan Morajkar - avatar
0
Which language?
7th Jun 2021, 1:17 PM
Eashan Morajkar
Eashan Morajkar - avatar
0
Are you sure about that? Have you made the calculator
7th Jun 2021, 1:26 PM
Eashan Morajkar
Eashan Morajkar - avatar
0
I think you mean javascript
7th Jun 2021, 1:27 PM
Eashan Morajkar
Eashan Morajkar - avatar
0
Create an array. Push the whole calculation into the array every time it's calculating something(I mean when user clicks the = button)
8th Jun 2021, 5:14 AM
Prasant
Prasant - avatar