0% found this document useful (0 votes)
87 views4 pages

Session 1

This document contains instructions for writing JavaScript scripts to: 1) Display a message entered by the user using different HTML heading tags using a loop. 2) Calculate the sum of values entered by the user until they enter 0 or the sum exceeds 100, ensuring values are numeric. 3) Count the number of 'e' characters in a string entered by the user. 4) Determine if a string entered by the user is a palindrome, considering or ignoring case sensitivity. 5) Get user information, validate it, and display a welcoming message with today's date in a color chosen by the user.

Uploaded by

Asmaa Mohamed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views4 pages

Session 1

This document contains instructions for writing JavaScript scripts to: 1) Display a message entered by the user using different HTML heading tags using a loop. 2) Calculate the sum of values entered by the user until they enter 0 or the sum exceeds 100, ensuring values are numeric. 3) Count the number of 'e' characters in a string entered by the user. 4) Determine if a string entered by the user is a palindrome, considering or ignoring case sensitivity. 5) Get user information, validate it, and display a welcoming message with today's date in a color chosen by the user.

Uploaded by

Asmaa Mohamed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1.

Basics

1.1. Ask the user to enter a message then display it using the different
html heading tags (from <h1> to <h6>) using Loops. DO NOT write the
header element explicitly in your script!

1.2. Write a script that takes from the user n values and returns their
sum, stop receiving values from user when he enters 0 or sum exceeds
100, check that the entered data is numeric and inform the user with
the total sum of the entered values.

2. String, Date and RegExp Objects

2.1. Write a script that accepts a string from user through prompt and
count the number of ‘e’ characters in it.
2.2. Write a script to determine whether the entered string is
palindrome or not. Request the string to be entered via prompt, ask the
user whether to consider case sensitivity of the entered string or not via
confirm, handle both cases in your script
i.e. RADAR NOON MOOM are palindrome.
Note: raDaR is not a palindrome if user requested considering case of
entered string, it will be palindrome if user requested ignoring case
sensitivity.
2.3. Write a script that reads from the user his info; validates and
displays it with a welcoming message with today’s date

Use coloring format according to user’s choice. The user has to choose
either red, green or blue color, take his choice via prompt.
3. Array Object
3.1. Fill an array of 3 elements from the user, and apply each of the
following mathematical operations on it (+, *, /).
Format the output as shown in Fig.

3.2. Fill an array (5 numerical values) from the user, Sort it in descending
and ascending orders then display the output as shown in Fig.
4. Math Object
Write a script that ask the user to
 Enter the value of a circle’s radius in order to calculate its area as
shown in fig.

 Enter another value to calculate its square root and alert the result
as shown in fig.

 Enter an angle to calculate its cos value then display the output as
shown in Fig.

You might also like