Question: Now we are going to write our very first runnable JavaScript. Download a1.zip from D2L and extract the a1.html file. Rename it as a1_YourFirstName.html. Inside
Now we are going to write our very first runnable JavaScript. Download a1.zip from D2L and extract the a1.html file. Rename it as a1_YourFirstName.html. Inside the tags add the necessary JavaScript to create a word problem that includes a question and answer.
A sample word problem may look like: Q: John works for 34 weeks in a year and enjoys for the rest of the weeks. For how many weeks John enjoy? (Assume 52 weeks in a year.) A: 18
The next time the page loads, the numbers should change, so the problem may look like: Q: John works for 26 weeks in a year and enjoys for rest of the weeks. For how many weeks John enjoy? A: 26
The number (number of weeks John works) used in this word problem should change randomly. This means that we need to generate the numbers for the questions and the answer using JavaScript.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
