Anda di halaman 1dari 3

Technological Institute of the Philippines

938 Aurora Blvd. Cubao, Quezon City

College of Information Technology Education

IT 004– Web Systems and Technologies

Preliminary Period
Writing JavaScript using Control Structures and Popup Boxes

Name: SURNAME, FIRSTNAME MI Date:


Program / Section: Instructor: Ms. Roxanne A. Pagaduan
Assessment Task: Quiz No. 2 (Hands-on)

Instructions:
- Provide screenshots to satisfy the requirements.
- Include your FULLNAME in every screenshot.
- You are required to provide the screenshot of your source code for each files like (.html, .css, .js)
and a sample output running in the browser.
- Include brief description in each screenshot.
- Save your work as SURNAME_PrelimQuiz2.DOC (Ex. PAGADUAN_PrelimQuiz2.DOC and
.PDF)

Requirements:
 Using different types of client-side programming language satisfy the following requirements.
 Use appropriate methods in JavaScript to solve the problems.

Part I – Using Arrays

1. Create a program that will display array of colors.


Sample Output:
My favorite colors are: red, blue, green, yellow, purple, orange
*Save your work as SURNAME_PQ2_array_colors.html

2. Add a prompt box that will get a number from the user. Ask the user for a number between 0 and 5.
Use that number to grab an element from the array. (Technically it would ask for
an integer between 0 to 5).
*Save your work as SURNAME_PQ2_prompt_colors.html

Sample Output:

The page will display a link.

If the user click the link, it will ask you to enter a number between 0 to 5
Pat II – Using Popup Boxes and Control Structures

1. Create a program that will prompt for secret code. If secret code is correct it will display “Yes! That
is the correct password.” Otherwise, “Nice try, but that is not the secret password!”
*Save your work as SURNAME_PQ2_popup.html

Sample Output:

2. Create a program that will prompt for secret code. This time there will be a secret code for
administrator, developer, and ordinary user. If the user type the administrator code, it will display
“You have administrator access”. If the user types the developer code, it will display “You have
developer access”. If the user type the ordinary user code, it will display “You have a user access”.
Otherwise, if the code is incorrect it will display “Password Incorrect!” (note: use switch statement)
*Save your work as SURNAME_PQ2_users.html
ANSWER:

Anda mungkin juga menyukai