Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Assignment 3 – Writing Functions Task 1: Make modifications in the sample code – 5 point Task 2: Write your Own Code – 5 points Task 1: Make modifications in the sample code Transform the following...

1 answer below »
Assignment 3 – Writing Functions
Task 1: Make modifications in the sample code – 5 point
Task 2: Write your Own Code – 5 points
Task 1: Make modifications in the sample code
Transform the following multi-condition if statements into a switch sample code. Save the program as T1.html
!DOCTYPE html
html xmlns=”http:
www.w3.org/1999/xhtml”
ody
script type=”text/javascript”
var myAge = Number(prompt(“Enter your age”,30));
if (myAge >= 0 && myAge <= 10)
{
document.write(“myAge is between 0 and 10

“);
}
if ( !(myAge >= 0 && myAge <= 10) )
{
document.write(“myAge is NOT between 0 and 10

“);
}
if ( myAge >= 80 || myAge <= 10 )
{
document.write(“myAge is 80 or above OR 10 or below

“);
}
If ( (myAge >= 30 && myAge <= 39) || (myAge >= 80 && myAge <= 89) )
{
document.write(“myAge is between 30 and 39 or myAge is between 80 and 89”);
}
script
ody
html
Task 2: Write your Own Code
Write a JavaScript program embedded in a HTML document with the following requirements:
· Request the user to enter a numbe
· Check if the user input is not empty. Also check value entered is a numbe
· Write on the html document a triangle out of the numbers as follow:
E.g. output: (let’s say the user entered number 10)
Your input number is 10.
10
11 11
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
XXXXXXXXXX
· The triangle should have 6 rows.
· Use Comments explaining how the program works
· Follow Indentation for clarity purposes.
· Save the program asT2.html
Bundle together all files and save the archive as A3_LastName_FirstName.zip. Upload the archive into the LMS using the A3 upload link.
Good Luck!
1
Answered Same Day Nov 16, 2021

Solution

Sudipta answered on Nov 17 2021
147 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here