Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Html/javascript, I need help creating a web page that rolls a pair of dice when a button is clicked. It should prompt the user

In Html/javascript, I need help creating a web page that rolls a pair of dice when a button is clicked.

It should prompt the user for the number of times the dice should be rolled. These rolls will be thrown out (burned) and then use the last roll.

The value the user enters is between 1 and 100.

There should be a line that shows the total of the last roll. On the initial run of the web page roll line should = 0 but after all the rolls it should show the total.

There should be a line that shows the total of the last roll. On the initial run of the web page roll line should = 0 but after all the rolls it should show the total.

They should look like the screen shots below.

image text in transcribed

This is the code I have right now, and I'm stuck on how to get it working.

Function dice()

{

diceimg1=one.png;

diceimg2=two.png;

diceimg3=three.png;

diceimg4=four.png;

diceimg5=five.png;

diceimg6=six.png;

//saved images

var dice=math.floor(math.dice()*diceimg1.length);

//calculating

if(dice==1)

{

dice=1;

}

0
0

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

What are the elements of the marketing research proposal?

Answered: 1 week ago

Question

6. Conduct a cost-benefit analysis for a training program.

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago