Question: 2. [10 marks] Check Password (filename: checkpassword.html) Write JavaScript code that asks the user to enter the password for an account. You first make up
![2. [10 marks] Check Password (filename: checkpassword.html) Write JavaScript code that](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3308e16d53_70966f3308db5d02.jpg)


2. [10 marks] Check Password (filename: checkpassword.html) Write JavaScript code that asks the user to enter the password for an account. You first make up a password, and then asks the user to enter the password until it is correct or the user has attempted three times (use a while loop). Display the corresponding message at the end. 3. [15 marks] Counting Numbers and Computing Average (filename: countnumbers.html) Write JavaScript code that reads an unspecified number of integers until a zero is entered. It then determines how many positive numbers and how many negative numbers have been read, and computes the average of the input values, not counting the zero. Display the average as a floating-point number with two decimal places. Use a while loop or do-while loop for repetition control. (For example, if the users entered 1, 2,-1, and 0, your output should be like this: You entered 2 positive number(s) and 1 negative number(s), and the average value is 0.67) 1. [10 marks] Arithmetic Calculator (filename: arithmeticcalculator.html) Write code that performs the four basic arithmetic operations (+,-*. ). The code uses a single prompt box to ask the user to enter the first number, the operator, and the second number in this order. The code then displays the result in an alert message box. Use a switch statement. Each operator is a character and is a case in the switch block. Assume the numbers and the operator are separated by single spaces. There is no space at the beginning nor at the end. It is also assumed that the user always enters the expression correctly. A sample run has been shown below
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
