Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am very new to HTML so I am struggling with this. I need help with exercises 11.7 and 11.8. I have to add them

I am very new to HTML so I am struggling with this. I need help with exercises 11.7 and 11.8. I have to add them to the figure I have provided. I have no knowledge of how to add a reset button. I know how to make a button, but I dont know what to put for the onclick. Additionally, I have no knowledge of a SPAN and an if statement. Please help image text in transcribed
image text in transcribed
202CHAPTER 11 Condisional Ex times certain actions occur. For example, a particle priowhereas a bologist might win, atomic collisions that take place within a certaih oasis over the course of a might want to count the occur. For example, a particle physicist the number of encounters between animals at an ain time pe the course of a day. Certain ams provide a similar ability to record the number of times a certain action is any variable that is used to record application. In computer science event is known as a coun Then, each t ter. Before a counter begins tallying, it must have an initia cmte specified event occurs, the value of the counter is incremented terminology, Dave Reed 1. 30. parseFloat (document.getElement ByIdC rollSpan').innerHTML)+ 1; 32. body 33.
cinput type-"button" value-"Click to Rol1" onclick-"Rol1DiceO;"> chr 43 Number of rolls: 46.

47. Figure 11.7 Web page that uses a counter to keep track of dice rolls Imagine that users of your stats.htm1 page would like to perform repeated a dice simulator. It would greatly help these users if they were able to reset the counts within the page. This can be accomplished by reloading the page- thsl and doubles browser's reload button or reentering the page's address-but a more elegant sng on add another button to the page labeled Reset counters. When the user clickwo in the two text spans should be reset to 0. Add such a button to your page and appropriately EXERCISE 11.7 experiments with the EXERCISE 11.8 There are six different dice combinations that add up to 7:6-1,5-2,4-3,3-4,2-5, and 1-6, making it most common dice roll. Add an additional text span to your stats.html page that keeps track of the number of times the user rolls dice that total 7. The new SPAN element should appear below the existing ones and should be preceded by an appropriate label. Within the Rol1Dice function add if statement that checks whether the two rolls add up to 7 and, if so, incre the text span. This counter should also be reset to 0 when the user ercise 11.7). ments the sevens counter in clicks on the reset button (from Ex- Once you have done this, use your page to simulate repeated dice rolls. After a reasonable numberf rolls is your sevens count roughly one-sixth of the total number of rolls

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

ISBN: 0201844524, 978-0201844528

More Books

Students also viewed these Databases questions