0% found this document useful (0 votes)
3 views2 pages

JavaScript Fundamentals Assignment Guide

The document outlines a JavaScript Basics Assignment aimed at reinforcing fundamental concepts such as variables, data types, operators, and control structures. It includes tasks for declaring variables, creating a calculator, and implementing control structures like loops and conditionals. The assignment is divided into three parts, each focusing on different JavaScript fundamentals.

Uploaded by

Navya Gupta
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)
3 views2 pages

JavaScript Fundamentals Assignment Guide

The document outlines a JavaScript Basics Assignment aimed at reinforcing fundamental concepts such as variables, data types, operators, and control structures. It includes tasks for declaring variables, creating a calculator, and implementing control structures like loops and conditionals. The assignment is divided into three parts, each focusing on different JavaScript fundamentals.

Uploaded by

Navya Gupta
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

JavaScript Basics Assignment

Objective:

To reinforce the understanding of JavaScript fundamentals, including variables, data


types, operators, control structures.

Part 1: Variables and Data Types

1. Task 1: Declare three variables named firstName, lastName, and age. Assign
them appropriate values that represent your first name, last name, and age.
2. Task 2: Create a new variable fullName by concatenating firstName and lastName.
Print fullName to the console.
3. Task 3: Declare a variable isAdult and assign it a value based on whether age
is greater than or equal to 18. Print isAdult to the console.

Part 2: Operators

1. Task 4: Create a simple calculator that performs addition, subtraction,


multiplication, and division on two numbers num1 and num2. Print the results to
the console.
2. Task 5: Use the modulus operator to determine if num1 is even or odd. Print
the result to the console.

Part 3: Control Structures

1. Task 6: Write a script that checks the value of age and prints a message
indicating whether the person is a child, teenager, adult, or senior.
2. Task 7: Write a for loop that prints numbers from 1 to 10 to the console.
3. Task 8: Write a while loop that prints all even numbers between 1 and 20.

You might also like