Question: USING HTML AND JAVASCRIPT You need to create a web page that take three user inputs, named start, end, and step (I would prefer a

USING HTML AND JAVASCRIPT

You need to create a web page that take three user inputs, named start, end, and step (I would prefer a form).

You need to convert the input strings into integers. The start is the first number, the end is the last. The step is the increment and might be positive or negative. If any of the input is invalid, for example, if the step is a or 0 (step cannot be 0), instead of a number, display an error message.

If all three inputs are correct, then write three functions. The first function generates an array of integer based on the three parameters. The second one computes the sum of all array elements. The last one converts the value into an array of binary representation of the integers.

For example, if the input is 3, 10, 1. The output is as the following:

The generated array is 3,4,5,6,7,8,9,10

The sum is 52

The binary of absolute values are: 11,100,101,110,111,1000,1001,1010

For example, If the input is 10,4,-3, the output is:

The generated array is 10,7,4

The sum is 21

The binary of absolute element values are: 1010,111,100

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 Databases Questions!