JavaScript_Syllabus_Assignment_LabPractice
JavaScript_Syllabus_Assignment_LabPractice
in
+91 88230 75444
+ 91 99939 28766
401, Shekhar Central, Palasia Square, Indore, MP - 452001
JavaScript
Section 1 – Building block , I/O, Operators & Expressions
- Variable and Data Type
- Input and Output - prompt and alert, console environment,
- Initialization Constant Escape Sequence - var, let, const
- Arithmetic Operator , Relational and Logical Operator , = = =
- Increment & Decrement Operator , Assignment Operator
- Conditional Expression
- Precedence & Order of Evaluation
- Type Conversion
- Functions and Click Event, GetElementByID, innerHTML, innerText
Note : Complete all example and assignment using HTML input fields, button and other
elements
*1. Write a program to accepts a number from user and check given number is even or odd.
*2. Write a program to accepts two numbers from user and calculates first no is divisible by
second or not.
*3. Write a program to accepts three numbers from user and calculate biggest number out of
three numbers.
*5. Write a program to input basic salary of an employee and calculate its Gross salary
according to following:
*6. Write a program to show day of week according to user input by using switch case.
*7. Write a program to perform all arithmetic operations according to user choice (for ex-for
addition press ‘+’...) by using switch case.
*8. Write a program to find maximum between two numbers.
*9. Write a program to find maximum between three numbers using if-else and ternary
operator.
*10.Write a program to calculate sum of digits of a number of three digit number using if-
else
*11. Write a "Bonus Distribution Program" using logical operators. Bonus will be given to
all those employees who have salary less than 20000 and tenure is more than 3 years.
*12 Write a code (using nested switch case) to suggest a diet plan (calories) to
a consumer on behalf of inputs(gender and food time).
#1. Write a program that accepts the age of person, find out the person is eligible for voting
or not.
#2. Write a program that accepts a number from user and find whether it is positive or
negative or zero.
#4. Write a program that accepts five subjects’ marks from user and calculate the total marks
then calculate Percentage. Display message according to following condition:
*1. Write a program to print “Code Better” five times by using loop.
*2. Write a program to print n natural number.
*3. Take any ten numbers from user and print sum and average of these numbers.
*4. Take any ten numbers from user and print sum and average of positive numbers.
*5. Take the numbers from user (until ten +ve numbers entered by the user), and print sum
and average of these numbers.
*6. Write a program to calculate factorial of a given number.
*7.Write a program to calculate sum of digits of a number.
*8. Write a program to find out reverse of a given number.
*9. Write a program that accepts a number from user and check given number is Armstrong
number or not.
*10. Write a program to find LCM of two numbers.
.e.g. LCM of 4 and 6 is 12
*11. Write a program to find HCF of two numbers.
.e.g. HCF of 16 and 24 is 8
#12. Write a program that accepts a number from user and check given number is prime
number or not.
#13. Print Fibonacci series unto n terms 0,1,1,2,3,5,8,……
Section 4 - Functions
- Function Types , Function Parameter, Function Declaration
- Call by value & Call by reference
- Scope, Visibility & Lifetime of Variable
- Recursion
*3. Write a program to find sum of digits of a given number using recursion.
*4. Write a program to check whether a number is palindrome or not using recursion.
#1. Write a program to check the prime number using function with argument and no return
type.
#2. Write a program to calculate factorial using function with argument and with return type.
#3. Write a program to print all even or odd numbers in given range using recursion.
#4. Write a program to find LCM of two numbers using recursion.
#5. Write a program to print all natural numbers between 1 to n using recursion.
Section 5 - Array
- 1-D Array
- Nested array
- Pass Array to Function, Return Array from function
#1. Write a program to count total number of even and odd elements in an array.
#2. Write a program to copy all elements from an array to another array.
#7. Write a program to check whether two matrices are equal or not.
#8. Create an array of size 3x10 containing multiplication tables of the numbers 2,7 and 9,
respectively.
#10 Write a program to print words representation of entered number. e.g. if entered number
is 245983 then result should be Two Lac Forty Five Thousand Nine Hundred Eighty Three
#11. Ask user to enter any four numbers between 1 to 9 and print all numbers made using
combination of these four number. Do not repeat any digit in the same number.
#12. Find 2nd highest number from and 2nd minimum from array of n elements.
- Declaring Strings in
- String Comparison
- String Functions
- Date and Formats, Date operations
*2. Write a program to take two strings as input from the user. Confirm that the strings are
equal.
*3. Write a program to find total number of alphabets, digits or special character in a string.
#1. Write a program to convert string into lowercase without any library function.
#3. Write a program to count total number of vowels and consonants in a string.
#1. Create a Calculator with HTML and Javascript without using eval
function.
#2. Create a StopWatch in HTML and Javascript.
#1. Create BankAccount Management App to store , delete, update, list, deposit,
withdraw,search records of Bank Account. Store accNo, customer name, balance,
account type
*2. Create a class DemoArithmetic with three data member that are firstNo, secondNo and result .
In this class also create following method:
a. inputValue() - to take input value from user for firstNo and secondNo
b. addition() - to perform addition operation and store in result var
c. substraction() - to perform substraction operation and store in result var
d. multiplication() - to perform multiplication operation and store in result var
e. divide() - to perform divide operation and store in result var
f. show() - display value of result variable.
*3. Create a class Student with data member(stuName, stuId, stuPercentage) to store the
information of student And also create following method:
a. inputStuInformation() - to take infromation about student from user
b. outputStuInformation() - to display information of student
*4. Create a class Addition with member function addition() with following given argument
a. three float
b array of integer
c two integer
*5. Create a class Student with data member (stuId ,stuName ,stuPer) ) by using following
properties:
a. Only parameterized constructor;
b. ShowStuInformation() method - display the information of student.
c. Create three student object and call ShowStuInformation method
#3. Create class BankAccount with data members accountNo, name, balance.
- Create display() method.
- Create another method deposit(amount:Float) which add amount value to balance
- Create withdraw(amount:Float) method which subtract amount from balance.
- Store 5 BankAccount Information in an Array and display all records. Ask user to select
choice from below and perform operation
1. Display account detail by account number
2. Deposit amount in account by account number
3. Withdraw amount in account by account number
4. Delete account by account number.
#1. Create an anonymous function that checks if a given number is even and returns true if it is, otherwise false.
#2. Implement a function that takes a callback function as an argument and calls it after a specific time delay.
#3. Filter an array of strings to find words containing the letter 'a'.
#4. Use `map()` to convert an array of Fahrenheit temperatures to Celsius.
#5. Given an array of names, create a new array of objects with a "name" property for each name.
#6. Use `reduce()` to find the maximum number in an array of numbers.
#7. Check if any element in an array is negative using `some()`.
#8. Determine if all elements in an array are greater than 10 using `every()`.
#9. Sort an array of strings in ascending alphabetical order using `sort()`.
#10. Sort an array of objects by a specific property, such as "age."
#11. Find the first even number in an array of integers using `find()`.
#12. Use `find()` to locate an object with a specific key-value pair in an array of objects.
#13. Calculate the total price of items in a shopping cart array using `reduce()`. Each item in the cart has a "price"
property.
#14. Given an array of words, filter out words shorter than 5 characters, capitalize the remaining words using
`map()`, and then join them into a single string.
#15. Build a function that logs the timestamp of when it was last called. Ensure that the timestamp is stored
within a closure.
#16. Create a curried function `add` that takes three arguments and returns their sum. You should be able to call it
like `add(2)(3)(4)`.
#17. Write a function that takes any number of arguments and uses the spread operator to concatenate them into a
single string.
#18. Write a function that takes a string and uses the rest operator to split it into an array of characters.
#19. Create an object with a `name` property and a function that prints “Hello, [name]!” Use the `bind()` method
to bind the function to the object and call it.
#20. Demonstrate the use of the `call()` method to concatenate two strings with a custom separator.
#21. Create a generator that generates a sequence of even number.