i need to be able to hand in as-is. will that be possible without having to change any code?
Assignment 1 – Declaring Variables and Data Types / Declaring and Creating Arrays Part 1 – Declaring Variables and Data Types Task 1: Type In Example Code and Run It – 2 points Task 2: Make modifications to the sample code – 4 point Task 3: Write your Own Code – 4 points Task 1: Type in Example Code and Run It Type the following into your text editor: Example output: · Save the file as T1.html. Task 2: Make modifications to the sample code Modify the following code to input age, phone and e-mail and display as an alert message (only one alert message) the name, age, phone and e-mail provided by the user. Save the program as T2.html. var greetingString = “Hello”; var myName = prompt(“Please enter your name”, “”); var concatString; document.write(greetingString + “ “ + myName + “ ”); concatString = greetingString + “ “ + myName; document.write(concatString); Output example: Hello Marry, WOW, you are 134 years old! I will contact you by phone 416-908-8766 or email:
[email protected] Thank you! Task3: Write your Own Code Write a program that converts miles to kilometers. There are 1.609 kilometers in a mile. The program should: · Use prompt function to accept what the user types in. · Read the user input in a variable $miles2convert, which is the distance to be converted (e.g. the user could type in 20 (miles)) · Convert the distance to kilometers using a mathematical operation (Note: Please note that there is no complicated math associated with task. All what you need to do is just read how many miles the user enters and multiply this number by 1.609). · Display on the webpage the result of the transformation as decimal. · Save the program as T3.html Output example: 20 miles = 32.18 Km Part 2 – Declaring and Creating Arrays Task 1: Write your Own Code – 4 points Task 2: Write your Own Code – 6 points Task 1: Write your Own Code The formula for calculating Body Mass Index (BMI) is Weight * 703 / (height*height). For example, if you weigh 200 pounds and are 72 inches tall, then you can calculate your body mass index with this expression: (200 * 703) / (72 * 72). Create a script that declares and assigns two integer variables: one for your weight in pounds and another for your height in inches. Declare another variable and assign to it the results of the body mass calculations. Use document.write() statements to print the value of the weight, height and BMI variables. Include text in the document.write() statements that describes each measure, such as “Your weight is 200 pounds”. Save the file as T4.html Task2: Write your Own Code Consider the following array (copy and paste the following array in your text editor) varmyArray = [1,5,1,1,5,2,4,5,2,3,2,4,2,4,2,3,2,3,2,4,2,3,2,4,2,5,1,4,2,4,2,3,2,4,1,1,5,1,1,5,2,4,5,2,3,2,4,2,4,2,3,2,3,2,4,2,3,2,4,2,5,1,4,2,4,2,3,2,4,1,1,5,1,1,5,2,4,5,2,3,2,4,2,4,2,3,2,3,2,4,2,3,2,4,2,5,1,4,2,4,2,3,2,4,1]; · Write a program to display the following: · Use only the length property, toString() , sort() and indexOf() methods to get information about the array. · Please note: no loops, conditional statements allowed on this assignment. · Save the file as T5.html Bundle together all files and save the archive as A1_LastName_FirstName.zip. Upload the archive into the LMS using the A1 upload link. 1