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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!