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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started