How do you setup prompt to use info entered multiple times, using all three variables entered into the answer. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do you setup prompt to use info entered multiple times, using all three variables entered into the answer.

I understand how to get a prompt up to answer questions, but not how to use the data entered in the box to change what happens next...

9th Feb 2019, 3:12 AM
John Gilbert
John Gilbert - avatar
3 Answers
+ 8
A simple ex, var a = prompt("Enter your age") if (a>=18){ document.write("You are an adult") } else { document.write ("You are not an adult") }
9th Feb 2019, 3:17 AM
Arushi Singhania
Arushi Singhania - avatar
0
Im working on a simple prompt calculation script that calculates the amount of meds left in a certain medication as well as the average amount of meds based on the x amount of days left in that medications 30 day month, all based on prompt questions asking last fill date and any extras taken Im running into an issue mentally, im not sure how to run a calculation based on days since last fill, . But im not sure how to base multiple variables like how many extras taken. Maybe im asking too much. Been stuck
9th Feb 2019, 1:05 PM
John Gilbert
John Gilbert - avatar
0
https://code.sololearn.com/WzPAno92UIt4/?ref=app Well khal academy had to teach me how to use functions, and knowing local and global viriable difference. But this program has its percs, and a grt playground!
14th Feb 2019, 4:52 AM
John Gilbert
John Gilbert - avatar