Description
SEE
Assignment 2
Deadline: Tursday 31/07/2024 @ 23:59
[Total Mark for this Assignment is 15]
Student Details:
Name: ###
ID: ###
CRN: ###
Instructions:
• You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on
Blackboard via the allocated folder. These files must not be in compressed format.
• It is your responsibility to check and make sure that you have uploaded both the correct files.
• Zero mark will be given if you try to bypass the SafeAssign (e.g. misspell words, remove spaces between
words, hide characters, use different character sets, convert text into image or languages other than English
or any kind of manipulation).
• Email submission will not be accepted.
• You are advised to make your work clear and well-presented. This includes filling your information on the cover
page.
• You must use this template, failing which will result in zero mark.
• You MUST show all your work, and text must not be converted into an image, unless specified otherwise by
the question.
• Late submission will result in ZERO mark.
• The work should be your own, copying from students or other resources will result in ZERO mark.
• Use Times New Roman font for all your answers.
Question One
Pg. 01
Learning
Outcome(s):
CLO3 Develop
dynamic web
pages using
JavaScript.
Question One
5 Marks
Write a JavaScript function that does the following:
1. Ask the user to enter their weight in kilograms using prompt().
2. Ask the user to enter their height in meters using prompt().
3. Calculate the BMI using this formula:
BMI = weight / (height * height)
4. Displays a message inside a on the page that tells the
user whether they are:
o Underweight (BMI 16 to less than 18.5)
o Normal weight (BMI 18.5 to less than 25)
o Overweight (BMI 25 to less than 30)
o Obese (BMI 30 and above)
o Severely Underweight (BMI less than 16)
5. If the BMI is less than 16 or more than 30, show a popup alert()
warning that says the user is in the danger zone.
Your function must use:
• prompt() to get input
• if…else statements for decision making
• DOM methods like getElementById() to show the result
Question Two
Pg. 02
Learning
Outcome(s):
CLO2 Create web
pages using
HTML5 and
CSS3.
Question Two
2.5 Marks
From the previous question, style the that displays the BMI message
using CSS.
Inside the section of your HTML, add a block, and write a CSS rule
using the ID selector to apply the following styles:
•
•
•
•
Font family: Arial
Font size: 18px
Text color: blue
Font style: italic
Remember to use:
•
•
ID selector syntax
Embedded (or internal) style sheet
Question Three
Pg. 03
Learning
Outcome(s):
Question Three
2.5 Marks
Use JavaScript to:
CLO3 Develop
– Change the text of the element with ID message to “Welcome to KSA”.
dynamic web
– Change the src attribute of the image with ID logo to ksa.png.
pages using
JavaScript.
Welcome to SEU
Question Four
Pg. 04
Learning
Outcome(s):
Question Four
5 Marks
Use JavaScript to:
CLO3 Develop
– Add a click event listener to the button with ID btn.
dynamic web
– When clicked, it should:
pages using
– Change the style color of the paragraph with ID description to red.
JavaScript.
Event Listener
This is the best.
Click
Purchase answer to see full
attachment