EMGT100 Introduction to Engineering
Programming in JavaScript
2
2019 University of Management and Technology
CST 221. Programming in JavaScript
Assignment 2
Instruction:
You can find help for this assignment from Module 3 on “Adding Parameters” and “Window Alert”.
Create a program that will do the following when run:
1) A window alert appears with the message “Click ok to see my name”. (Different
owser might display it differently)
2) Once you click ok, a line appears on the webpage that reads “My name is StudentName”. Put your name in place of the StudentName.
Requirements:
You must use a Function that will accept a variable called myname as a parameter.
The variable myname should be given the value of your first name.
The Function must be in a javascript file called second.js. Your html page should be called second.html (refer to assignment 1 if you forgot how to call javascript file from html file)
The Function must return the message to be displayed. Do not display the message inside the Function.
Use comments and lay the code out so it can be easily followed!
Each file in the assignment must have a comment at the top, using the co
ect commenting technique for the file type, like this:
Your Name
Your Student ID
Course ID
Assignment #
Put all your files in a folder, zip it and submit the zipped file.
If you get stuck, feel free to contact the Faculty for assistance at any time.