Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Use our HTML template to create a file named as your name (for example if your name is john the file name would be

1. Use our HTML template to create a file named as your name (for example if your name is john the file name would be john.html). Make sure to update the meta data (title, author, description) accordingly. This HTML file should contain an h1 heading element that includes your full name and student number.

2. Create a JavaScript file using your name as file name. Update your HTML file to include reference to this .js file to perform following exercise. Each output statement from your JavaScript should include your fist name at the beginning and be displayed in new paragraph.

a. Generate a random number between 0-100 using Math.random() and store it in a variable.

b. Prompt user to enter a number between 0-100 and store this number in another variable.

c. Display the two numbers on the screen as shown in following example, where John should be replaced by your name:

John: The numbers are 7 and 80

d. Use a conditional statement to determine which number is greater and display that on the screen:

John: The number you entered (80) is greater

e. Now that you know the greater of the two number, comparing that to the third number is very easy. Prompt user to enter another number between 0-100

f. Perform the same condition you did above to find the largest number, then display all three numbers in descending order as shown in sample below:

John: 80, 33, 7

g. Use the largest number for the next exercise to deduct mentioned percentage from it if applied:

i. If is greater than 75, apply 25 percent discount (value (value * .25))

ii. If is greater than 50, deduct 15 percent from it

iii. If greater than 20, deduct 10 percent from it

Display result on the screen accordingly:

John: 80 (80 * .25) = 60 h.

h. Find out if the second number entered by user is even or odd and display a message accordingly.

John: Number 80 is an even number

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_2

Step: 3

blur-text-image_3

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions