Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. In your text editor create a new file and save it as a2.html. Add all of the necessary HTML statements to create a basic

image text in transcribed
1. In your text editor create a new file and save it as a2.html. Add all of the necessary HTML statements to create a basic page (head, title, meta,body, etc). Then inside of the add the following line of code: 2. Create a new file in your text editor and save it in the same location as your a2.html. Call this new file a2.js. You should never write any HTML in this file, only JavaScript. 3. In a2.js, write the JavaScript to complete the following exercises. a) Write the JavaScript to read the number of hours worked from the user. Then write the JavaScript to calculate how much money the user made if they were paid $12/hour for the first 40 hours worked, and $18/hr for all hours worked over 40. Then use console.log to print out the hours entered and the total amount made. Sample Output: If the user enters 12 hours, your program should alert "In 12 hours you made $144" If the user enters 60 hours, your program should alert "In 60 hours you made $840" b) Write the JavaScript to read two integers from the user. If either number the user enters is ZERO you should print "You entered 0" to the console. Otherwise, if the first number is evenly divisible by the second number, then you should print "Second divides first" to the console. If the second number is evenly divisible by the first number, then you should print "First divides second" to the console. Finally, if neither number divides the other, then you should print "Not divisible" to the console. Sample Output (next page)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions