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 »
I only need Task 1 done.


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 var myAge = Number(prompt(“Enter your age”,30)); if (myAge >= 0 && myAge <= 10)="" {="" document.write(“myage="" is="" between="" 0="" and="">
“); } if ( !(myAge >= 0 && myAge <= 10)="" )="" {="" document.write(“myage="" is="" not="" between="" 0="" and="">
“); } if ( myAge >= 80 || myAge <= 10="" )="" {="" document.write(“myage="" is="" 80="" or="" above="" or="" 10="" or="">
“); } If ( (myAge >= 30 && myAge <= 39)="" ||="" (myage="">= 80 && myAge <= 89) ) { document.write(“myage is between 30 and 39 or myage is between 80 and 89”); } 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 number · check if the user input is not empty. also check value entered is a number · 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 12 12 12 13 13 13 13 14 14 14 14 14 15 15 15 15 15 15 · 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 89)="" )="" {="" document.write(“myage="" is="" between="" 30="" and="" 39="" or="" myage="" is="" between="" 80="" and="" 89”);="" }="" 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="" number="" ·="" check="" if="" the="" user="" input="" is="" not="" empty.="" also="" check="" value="" entered="" is="" a="" number="" ·="" 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="" 12="" 12="" 12="" 13="" 13="" 13="" 13="" 14="" 14="" 14="" 14="" 14="" 15="" 15="" 15="" 15="" 15="" 15="" ·="" 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!="">
Answered Same DayNov 16, 2021

Answer To: Assignment 3 – Writing Functions Task 1: Make modifications in the sample code – 5 point Task 2:...

Sudipta answered on Nov 17 2021
156 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