Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
JavaScript Lab Exercises: Taking User Input and Returning Output

Lab work

Overview
The purpose of today’s lab is to create a JavaScript to practice taking input from the user and returning output to the user. This lab will also allow you to practice using functions and if statements to accomplish small programming tasks.Lab work
1. Download A2.zip and extract the html file it contains. Have a look at the HTML file and notice the buttons and divs that have been created for you. Do not modify the HTML code. How to extract files: https://www.wikihow.com/Unzip-a-File
2. In Sublime/Atom/Notepad++ create a new file and save it as a2.js. Make sure that this file is in the same directory as a2.html.
3. In a2.js, write the JavaScript to complete the following exercises.
a) Write a function called convertWeight() that prompts the user to enter their weight in pounds and then displays that weight in kilograms in div1 on webpage. One pound is 0.454 kilograms.
b) Write a function called calculatePay() that prompts the user to enter how many hours they worked. The function should then display how much money the user makes if they are paid $12/hr for the first 40 hours worked, and $18/hr for every hour after that. Display the total pay in div2 on the webpage.
c) Write a function called makeUsername() that prompts the user to enter three separate pieces of information to store in variables: the first name, the last name, and the 4 digit birth year.The function should then print a username to div3 the webpage. The usernameshould contain the first letter of the first name, followed by the first 4 letters of the last name, followed by the last two digits of the birth year. The first two letters of the username should be capitalized, and the remaining letters should be lower cased.
d) Write a function called isValidNumber() that prompts the user to enter three separate pieces of information to store in variables: the minimum value, the maximum value, and a third number of the user's choice. The function should then display to div4whether the third number entered is within the range of the first two numbers entered.

support
Whatsapp
callback
sales
sales chat
Whatsapp
callback
sales chat
close