Task 1: Variables and Output
1. Declare the following variables:
o Student name (string)
o Age (integer)
o Is enrolled (boolean)
o Percentage marks (float)
2. Display a short introduction sentence using these variables inside HTML.
Expected Output Example:
Hello, my name is Sara. I am 22 years old and currently enrolled.
Task 2: Conditional Statements
1. Based on the percentage marks:
o 85 and above → Grade A
o 70 to 84 → Grade B
o Below 70 → Grade C
2. Display the percentage and the calculated grade.
Task 3: Arrays
1. Create:
o An indexed array of at least 5 programming languages.
o An associative array containing student details (name, email, city).
2. Display:
o All programming languages using a loop.
o Student details using array keys.
Task 4: Loops
1. Use a for loop to display numbers from 1 to 10.
2. Use a foreach loop to display all values of the programming languages array.
Task 5: Functions
1. Create a function named calculateAverage() that:
o Accepts three numbers as parameters.
o Returns their average.
2. Call the function and display the result in HTML.