+ 1

How do use one input for multiple purposes?

I'm trying to input a number once and use it in a math expression as well as print it later as a string. https://code.sololearn.com/c5CSAJrk4oqn/?ref=app

2nd Jun 2017, 12:51 AM
Khairi Warren
Khairi Warren - avatar
2 Answers
+ 2
put it in variable?
2nd Jun 2017, 12:52 AM
Amar
Amar - avatar
0
I'm not sure what that means. but I ended up scanning the number as a string and then separately converting it to a double by using Double.valueOf ().
2nd Jun 2017, 9:00 PM
Khairi Warren
Khairi Warren - avatar