0% found this document useful (0 votes)
16 views

LabWorks Objectives

Uploaded by

ad9861783880
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

LabWorks Objectives

Uploaded by

ad9861783880
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

*************************************

IMPORTANT INSTRUCTIONS [ Teacher : PRAVEEN KOIRALA]

1. Students are advised to prepare handwritten lab works. Cover page should be
printed.
2. Students should describe the theoretical part as per the objective of the lab on
the theoretical background section.
3. Students should write a program for each question. The output of the program
should be printed with the proper author name, program description and stick with
glue on the back side of the page.
4. Students should submit the lab work/report on the next lab day. Violation of any
rules result in late submission or need to rewrite the report.
*************************************

----------------- JavaScript -----------------------------------------------

----- Lab Work 1 : Web Technology II: JavaScript --------

Lab Objectives

To understand different variable types in JavaScript.


To get input from user and display output.
To perform arithmetic and logical operation in JavaScript.
To understand and apply different conditional and looping statements in JavaScript.
To understand the usefulness of JavaScript library (JQuery) and apply it.

Lab Questions

1. WAP to find area and circumference of circle.


2. Write a JS program to find the square root of a number. Here the number is
entered by the user.[Use Math object with method (Math.sqrt for square root) and
prompt method to input data]
3. Write a program to pick the greatest number among three numbers entered by
the user.
4. Write a program to input a number and know that it is an even or odd number.
[Use prompt for input and % operator to get remainder]
5. Write a program to input your name and age using form and know whether he/she
is eligible to vote or not. [ Use function and onclick event]
6. Write a program to perform following operations using switch structure.
If you enter A+, it says you have obtained grade A+.
If you enter A, it says you have obtained grade A.
If you enter B+, it says you have obtained grade B+.
If you enter B, it says you have obtained grade B.
If you enter any other value/character, it says you have obtained other grade.
7. WAP to print factorial value of a number.
8. WAP to print multiplication table of a number. Use function.
9. Write a program to reverse a string. [use loop from its length-1 to 0 and
print it]
10. An array contains multiple strings. Print them in reverse order.[use
array.reverse() method].
11. Write a program to insert a string “We are learning JS” via form object
getElementById() method. Use paragraph with id.
12. Input your name and grade using form. Validate this with a message ‘This
field is required’, using onclick() event.
13. Write any two paragraphs in your html page. Now write a program using JQuery
to hide that written paragraphs as you click on that.
14. Use JQuery to create an alert message for a button.

----------- DBMS ---------------

----- Lab Work 1 : Database Management System: SQL --------

Lab Objective
1. To understand the concept of RDBMS, Server Application and Services.
2. To understand Create a database and Table in database.
3. To understand DDL Command (CREATE, ALTER, DROP)
4. To understand DML Commands (INSERT, UPDATE, DELETE)
5. To understand DQL Commands (SELECT)

A. Database practical session-1

a) Create a database named ‘EMPLOYEE’.


b) Get inside the database.
c) Create a table named ‘employee’ with following fields.
Employee_id—int primary key not null auto increment
Employee_name--varchar(100)
d. Delete the table.
e. Know whether that deleted table exists or not.
f. Delete the database which you have created (student).
g. Know whether that deleted database exists or not.

B. Database practical session-2

a. Create a database named ‘student’.


b. Create a table ‘student’ with following fields.
Student_id--------------integer not null primary key auto increment
Student_name---------varchar(100)
Student_address-------varchar(100)
Student_grade----------integer(int)

c. Insert any 6 records using ‘insert’ and ‘values’ command.


d. Display all the records of all fields.(Use select *)
e. Display all the records of fields’ student_id and student_name.
f. Display records of students whose name starts with letter ‘a’.
g. Display records of students whose name ends at letter ‘y’.
h. Display all the records of students whose grade is 12. Use ‘where’ command.
i. Display all the records of students whose grade is 12 and who are from
address “Kathmandu”. Use ‘and’ operator.
j. Update the student name with any other name who has id 1.
k. Delete the record of student whose id is 3.
l. Display the records of students in sorted order using field ‘student_name’.
Use ‘order by field name asc/desc’.
m. Alter the table with following fields.
Add one more field student_section---varchar(100). [Use alter and add command]
Change the size of field student_address--200 [Use alter and modify command]
C. Database practical session-3

a. Create a database named ‘employees’.


b. Create a table ‘employee’ with following fields.
emp_id--------------integer not null primary key auto increment
emp_name---------varchar(100)
emp_position-------varchar(100)
emp_salary----------float

c. Insert any 6 records using ‘insert’ and ‘values’ command.


d. Display all the records of all fields.(Use select *)
e. Display all the records of fields’ emp_id and emp_name.
f. Display records of employees whose name starts with letter ‘ab’.
g. Display records of employees whose name ends at letter ‘y’ and starts from
‘b’.
h. Display all the records of employees whose position is ‘engineer’.
i. Display all the records of employees whose salary is in range 30000-45000.
j. Update the employees name with any other name who has id 1.
k. Delete the record of employees whose id is 3.
l. Display the records of employees in sorted order. Use ‘order by field name
asc/desc’.
m. Alter the table with following fields.
Add one more field employees_address ---varchar(100). [insert after name field]
Change the size of field employees _position--200 [Use alter and modify command]
n. Find the maximum and minimum salary in database.
o. Find the average salary distribution in database.
[Note: Use both shell interface and graphical interface for these operations]

----- C PROGRAMMING------

----- Lab Work 4 : C Programming: Working With Files --------

Objectives

1. To understand different modes of file operation.


2. To understand and apply file handling functions (putc(), putw(), fgets(),
fputs(), fprintf(), fscanf() ) in C.
3. To understand rename and remove a file.
4. To understand appending to a file.
5. To perform read and write to and from a file using fread() and fwrite()
function.

1. WAP to input a sentence and store data in a data file “file.txt”. And print them
on screen. Use getc() and putc() functions.

2. WAP to store some ‘n’ natural numbers in a data file and print them on screen.
Use getw() function. Also print their average.

3. WAP to store student’s name and address in a data file “student.txt”. Use
fprintf() function.
Then read contents of data file and print them on screen. Use fscanf() function.
4. WAP to store book’s name, edition and price in a data file “book.txt” using
yes/no options. It means the computer stores data until you say ‘n’. Then print
them on screen.

5. WAP to store employee’s name, designation and salary in a data file


“employee.txt” using fwrite(). The computer stores data until you say ‘n’. Then
read the contents of that file and print on screen using fread().

6. WAP to input students’ name, grade and marks in five subjects. Then store these
all data with total and percentage in a data file “student.dat”. Print all those
data of students who have percentage >=80. You may use fscanf() or fwrite().

7. WAP to show the concept of rename() and remove() functions.

8. WAP to show concept of ftell(), fseek() and rewind() functions.

----- Lab Work 3 : C Programming: Pointer --------

Objective
1. To become familiar with the concept of a pointer.
2. To understand that variables are stored in memory locations that can be referred
to by their addresses.
3. To understand Pointer and Array
4. To understand passing pointer as function argument

Lab Work

1.WAP to perform arithmetic calculations (sum,difference, multiplication and


division) of two numbers using pointers.
2.WAP to know a number is even or odd using pointer.
3.WAP to find sum and average of ‘n’ natural numbers using pointer.
4. Use array to input 10 elements and print them. Use array as pointer.
5.WAP to input 10 elements and print maximum and minimum value. Use array as
pointer.
6.WAP to swap two values using call by reference and call by value.
7.WAP to sort 10 numbers stored in an array using pointer.
8.WAP to print multiplication table of a number using pointer.

----- Lab Work 2 : C Programming: Structure and Unions --------

Lab Objectives:
1. To understand declaration and initialization of structure in C.
2. To understand accessing structure members.
3. To understand the concept of nested structure.
4. To understand concept of array using structure.
5. To understand passing structure as a function argument.
6. To understand the concept of Union.

Lab Works

1. WAP to input id, name and grade for 5 students. Then print them. Use array of
structure concept.
2. WAP to input 5 employees name, position and salary. Then search a record of an
employee and its position on the basis of name.
3. We have two structures as given below.struct employee{ char ename[100]; char
eaddress[100];};struct salarydetails{char pos[100];float salary;struct employee
detail;}payinfo; WAP to input employees’ details with salarythen print them. Use
nested struct concept.
4. WAP to input id, name and address of 20 studentsusing struct. Then print them in
sorted format on the basis of name.
5. WAP to input any 10 teacher’s id, name and subject using ‘typedef’ and
structure. Then print them on screen.
6. WAP using function and structure to calculatesum of two distances measured in
terms of kilometers and meters.
For example, If we input following data
Kilometer meter
23 445
45 756
69 201
The output would be 69 km and 201 meters.
7.WAP to input student id, name and grade and print them. Use union concept.

----- Lab Work 1 : C Programming: Functions ----

Lab Objectives

1. To understand function and its types.


2. To understand different categories of user defined function and apply them.
3. To understand calling function and returning value from function.
4. To understand passing Array as arguments to a function.
5. To understand the concept of recursion and recursive function.

Lab Works

1. WAP to find sum of two numbers using function named sum().


2. WAP to know a number is even or odd using function named evenodd().
3. WAP to print the greatest value among threenumbers using a function int
great().We have to use return statement.
4. WAP to know a number is prime or composite using function.
5. WAP to find sum of series 1,2,3,…..200 using function. Assume yourself function
name. It returns aninteger value.
6. WAP to input elements of an array and print themwith their sum. Suppose, the
array is one dimensional and is of void type andfunction to be used is
array_elements().
7. Suppose a function void matrix_sum(int a[][],intb[][]).Here, we have passed
array as parameter. Use this function to find sum of matrices.
8. WAP to sort ‘n’ number of strings usingfunction. Pass strings as parameter.
9. WAP to find factorial value of a number using recursive function.

You might also like