Problem 2: Using HTML/JavaScript, find and display the number of multiples of a certain number entered by the user. First have the user enter a number in a prompt box from 1-10. Check if they enter a valid number - if they don't, prompt them again. Use a loop for this. Next, use a second loop to have the user enter a number in a prompt box and determine if it is a multiple of the number they entered. Keep count of how many multiples of their number they entered. Have the user enter a 0 when they are finished entering numbers. At the end, print out the number of multiples of their number they entered.

Question

Problem 2: Using HTML/JavaScript, find and display the number of multiples of a certain number entered by the user. First have the user enter a number in a prompt box from 1-10. Check if they enter a valid number - if they don't, prompt them again. Use a loop for this.

Next, use a second loop to have the user enter a number in a prompt box and determine if it is a multiple of the number they entered. Keep count of how many multiples of their number they entered. Have the user enter a 0 when they are finished entering numbers. At the end, print out the number of multiples of their number they entered.

Expert Answer

Want to see the step-by-step answer?

See Answer

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

See Answer
*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.

Related Computer Science Q&A

Find answers to questions asked by student like you

Q: PLEASE EXPLAIN ALL STEPSDevelop a k-map to simplify the equation (truth table included)

A:  Given boolean expression = xz + (xy + ~z)Now by using given truth table, draw a K-map of 8 cells by...

Q: Question 2: Which statement(s) is/are true about vectors? a) A vector's size is static. b) A vector'...

A: VectorsA vector is an object that has both magnitude and direction. It is a directed line segment wh...

Q: in python   Write a Python program that uses a for loop with the range function to inspect all integ...

A: Multiples() function defines to display these two totals.

Q: What is the name of a domain controller on which changes can't be written? Group of answer choices ...

A: Domain Controller:A domain controller is a server that responds to the demand for security authentic...

Q: Python   1. Write a for loop (using the range() function) that will print the integers 10,15,20,25,3...

A: Program:#display the statementprint("The integers are: ") #iterate "i" in the range of 10 to 51 with...

Q: 4.7: Time Machine Your time machine is capable of going forward in time up to 24 hours. The machine ...

A: Following is the c++ program:Variables used:startHours, startMins are used to store the starting tim...

Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...

A: The name of the program is CharCounter.inputEntry is a string type variable and used for storing use...

Q: E

A: E) The transition diagram for the given DFA is shown as:

Q: Discrete Structures Section 1.2 Exercise Q9 and Q11. Show that each of the following conditional st...

A: With using Truth Table: a. ( p ^ q ) -> ppqp^q(p^q) -> p0001010110011111  b. p -> ( p v q )...