Javascript Program writing
Task A
1.1 As a JavaScript programming student ,I want to establish code with a variable `isHappy` and assign it a boolean value based on the value of the given String variable `action`, whether it is `Smile` or not.
1.2 As a JavaScript student, I want an illustration showing output of a code with a variable `favoriteSubjects` and assign it an array of strings representing your favorite subjects. As a student of JavaScript programming
1.3. As a JavaScript student, I want an illustration showing output of a program to compare two numbers, `num1` and `num2`, and check if `num1` is greater than or equal to `num2`.
1.4. As a student of JavaScript programming I am required to outline a program to calculate the square of a given number, `num`.
1.5. . As a student of JavaScript programming I am required to outline the output of a program to check if a given number, `num`, is even or odd.
1.6. As a student of JavaScript programming I want to outline the output of a code to check if a given year, `year`, is a leap year and divisible by 400 or divisible by 4 but not divisible by 100.
1.7. As a student of JavaScript programming I want to obtain a program that checks if a given character, `char`, is a vowel or a consonant.
1.8. As a student of JavaScript programming I want to outline a program that determines the largest among three numbers, `num1`, `num2`, and `num3`.
1.9. As a Javascript programmimg student, I want to generate a program that determines the sign of a given number, `num` (positive, negative, or zero), using the ternary operator.
1.10. As a Javascript programmimg student, I want to generate a code that determines the grade based on a given percentage, `percentage`. Use the following grading scale: A (90-100), B (80-89), C (70-79), D (60-69), F (0-59).
Task B
2.1 As a Javascript programming student, I want to generate a program that determines the type of triangle based on the lengths of its sides (`side1`, `side2`, and `side3`). The types of triangles are equilateral, isosceles, and scalene.
2.2. As a Javascript programming student, I want to generate a JavaScript program that counts the number of occurrences of a specific element in an array using a for…of loop.
2.3. As a Javascript programming student, I want to generate a function that takes an array of product prices and returns the total price. You can assume that the array contains only numbers.
2.4 As a Javascript programming student, I want to generate a function that takes an array of product prices and a discount percentage. Apply the discount to each product price and return the updated prices as an array.
2.5. As a Javascript programming student, I want to generate a function that takes an array of product quantities and returns an array of indices for products that are out of stock (quantity is 0)