Question: Using HTML and external JavaScript file CODE this. Please help me! This is the first one: This is a 2 one: (These are 2 different


1. Read the input from the document. This string must be between 10 and 20 characters long, inclusive, and consist of only 0 's and 1 's. If the string does not meet these conditions, output the result 0 . If the input is valid then interpret it as a binary number. Using only loops and substring operations calculate the integer value of the binary number. For simplicity, we will assume "little endian" numbers ... the smallest number is on the left and get bigger moving to the right. Recall that binary values are powers of 2 , with the first few values being 2=1,21=2,20+21=3, etc. 2. Read the input from the document. If it is an integer, split the absolute value of the integer apart and add up all the digits. If the resulting sum is greater than 9 , repeat this process until the result is a single digit. Output the result of the calculation. If the original input was not an integer output "Bad input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
