0% found this document useful (0 votes)
8 views27 pages

HTML DS Workbook

This document is a workbook for S. Y. B. Sc. (Computer Science) students at Tuljaram Chaturchand College, detailing Lab Course I assignments based on Advanced Data Structure and Web Technology as per NEP 2023 Pattern. It includes instructions for students and instructors, outlines the structure of assignments, and provides examples of recursion in C++. Additionally, it features specific lab assignments related to recursion and queue data structures, along with evaluation criteria.
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)
8 views27 pages

HTML DS Workbook

This document is a workbook for S. Y. B. Sc. (Computer Science) students at Tuljaram Chaturchand College, detailing Lab Course I assignments based on Advanced Data Structure and Web Technology as per NEP 2023 Pattern. It includes instructions for students and instructors, outlines the structure of assignments, and provides examples of recursion in C++. Additionally, it features specific lab assignments related to recursion and queue data structures, along with evaluation criteria.
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
You are on page 1/ 27

Anekant Education Society‟s

Tuljaram Chaturchand College


of Arts, Science & Commerce, Baramati - 413102
(AUTONOMOUS)
Affiliated to
Savitribai Phule Pune University, Pune

DEPARTMENT OF COMPUTER SCIENCE

S. Y. B. Sc. (Computer Science) Sem- IV


COS-254-MJM

Lab Course I : Based on COS-251-MJM, COS-252-MJM


As Per NEP 2023 Pattern (NEP 1.0)

Name of Student : __________________________________________________________

Roll No.: _______________ Division : ________ Academic Year : _______________


Anekant Education Society‟s
Tuljaram Chaturchand College
of Arts, Science & Commerce, Baramati-413102
(AUTONOMOUS)
Affiliated to
Savitribai Phule Pune University, Pune
DEPARTMENT OF COMPUTER SCIENCE

- CERTIFICATE -
University Seat No. : ________________ Date: / /

This is to certify that Mr. /Miss. /Smt._________________________________


________________________ has satisfactorily completed the course in the
practical as prescribed by Tuljaram Chaturchand College of Arts, Science &
Commerce, Baramati (Autonomous), affiliated to SPPU for the S. Y. B. Sc.
(Computer Science), Lab Course I : Based on COS-251-MJM, COS-252-
MJM (As Per NEP 2023 Pattern (NEP 1.0)) in the Year 20 - 20

In-Charge Internal External HOD


Practical Examiner Examiner Computer Science

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 2


Introduction
1. About the workbook
This workbook is intended to be used by S. Y. B. Sc. (Computer Science) students for the Lab
Course I : Based on COS251-MJM, COS-252-MJM Assignments in Semester IV.

1. How to use this workbook.


The workbook contains assignments related to Advanced Data Structure & Introduction to Web
Technology.
The Workbook is divided into fifteen assignments. Each assignment has two/three sets. It is
mandatory for students to complete all the sets in given slot. First Set contains the programs on
Data Structure , Second set contains programs in Web Technology and third set contains extra
programs for practice.Data Structure programs should be implemented using C++ language.
Each Assignment has a SET A , SET B and SET C sets. SET A and SET B are Compulsory. SET
C is optional. Depending on time availability student should complete more sets at the time of
practical in the lab.

2.1 Instructions to the students


Please read the following instructions carefully and follow them.
1. Students are expected to carry this book every time they come to the lab for computer
science practical.
2. Students should prepare oneself beforehand for the Assignment by reading the relevant
material.
3. Instructor will specify which problems to solve in the lab during the allotted slot and
student should complete them and get verified by the instructor. However, student should
spend additional hours in Lab and at home to cover as many problems as possible given in
this workbook.
4. Students will be assessed for each exercise on a scale from 0 to 5
I) Not done 0
II) Incomplete 1
III) Late Complete 2
IV) Needs improvement 3
V) Complete 4
VI) Well Done 5
2.2. Instruction to the Instructors
a) Explain the assignment and related concepts in around ten minutes using white board if
required or by demonstrating the software.
b) Choose appropriate problems to be solved by students.
c) Make sure that students follow the instruction as given above. Students should be
encouraged to solve more sets than specified.
d) You should evaluate each assignment carried out by a student on a scale of 5 as specified
above by ticking appropriate box.
e) The value should also be entered on assignment completion page of the respective Lab
course.
2.3. Instructions to the Lab administrator
You must ensure appropriate hardware and software is made available to each student.
The operating system and software requirements on server side and client side are as
given below: You have to ensure appropriate hardware and software is made available to each
student.

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 3


PART – A : Advanced Data Structure
Assignment Completion Sheet

Marks Teacher
Sr. No Assignment
(out of 5) Sign
1. Assignment 1

2. Assignment 2

3. Assignment 3

4. Assignment 4

Total (out of 20)

Total (out of 10)

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 4


Assignment - 1 : Recursion

Objectives
 To learn recursion.

 To learn different recursive functions.

Reading
You should read the following topics before starting this exercise
1. About functions.
2. Different function types and calling methods.

Ready Reference
Assume that you have to paint a few balls. If you do it alone, it will take a lot of time. One thing you
can do is to take help from your friend. Assuming that you have the same work speed, the task will be
done in half of the time. Now, instead of taking help from only one of your friends, you take help from
multiple friends such that each friend have only one ball to paint. The task will be done much faster as
compared to when you were doing it alone. Recursion is a problem-solving technique that works in a
similar way.

Recursion
Recursion in C++ is a technique in which a function calls itself repeatedly until a given condition is
satisfied. In other words, recursion is the process of solving a problem by breaking it down into smaller,
simpler sub-problems.
Syntax Structure of Recursion
return_type recursive_func {
....
// Base Condition
// Recursive Case
....
}

Recursive Function
A function that calls itself is called a recursive function. When a recursive function is called, it
executes a set of instructions and then calls itself to execute the same set of instructions with a smaller
input. This process continues until a base case is reached, which is a condition that stops the recursion
and returns a value.
Base Condition
The base condition is the condition that is used to terminate the recursion. The recursive function will
keep calling itself till the base condition is satisfied.
Recursive Case
Recursive case is the way in which the recursive call is present in the function. Recursive case can
contain multiple recursive calls, or different parameters such that at the end, the base condition is
satisfied and the recursion is terminated.
Example of C++ Recursion
The following C++ program illustrates how to perform recursion.

// C++ Program to calculate the sum of first N natural


// numbers using recursion
#include <iostream>
using namespace std;
SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 5
int nSum(int n)
{
// base condition to terminate the recursion when N = 0
if (n == 0) {
return 0;
}
// recursive case / recursive call
int res = n + nSum(n - 1);
return res;
}
int main()
{
int n = 5;
// calling the function
int sum = nSum(n);
cout << "Sum = " << sum;
return 0;
}
Output
Sum = 15
In the above example,
 Recursive Function: nSum() is the Recursive Function
 Recursive Case: The expression, int res = n + nSum(n – 1) is the Recursive Case.
 Base Condition: The base condition is if (n == 0) { return 0;}

Working of Recursion in C++


To understand how C recursion works, we will again refer to the example above and trace the flow of
the program.
1. In the nSum() function, Recursive Case is
int res = n + nSum(n - 1);
2. In the example, n = 5, so as nSum(5)’s recursive case, we get
int res = 5 + nSum(4);
3. In nSum(4), the recursion case and everything else will be the same, but n = 4. Let‟s evaluate the
recursive case for n = 4,
int res = 4 + nSum(3);
4. Similarly, for nSum(3), nSum(2) and nSum(1)
int res = 3 + nSum(2); // nSum(3)
int res = 2 + nSum(1); // nSum(2)
int res = 1 + nSum(0); // nSum(1)
Let‟s not evaluate nSum(0) and further for now.
5. Now recall that the return value of the nSum() function in this same integer named res. So, instead
of the function, we can put the value returned by these functions. As such, for nSum(5), we get
int res = 5 + 4 + nSum(3);
6. Similarly, putting return values of nSum() for every n, we get
int res = 5 + 4 + 3 + 2 + 1 + nSum(0);

7. In nSum() function, the base condition is


if (n == 0) {
return 0;
}
which means that when nSum(0) will return 0. Putting this value in nSum(5)‟s recursive case, we get
int res = 5 + 4 + 3 + 2 + 1 + 0;
= 15
8. At this point, we can see that there are no function calls left in the recursive case. So the recursion
will stop here and the final value returned by the function will be 15 which is the sum of the first 5
natural numbers.
SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 6
Recursion Tree Diagram of nSum(5) Function
Memory Management in C++ Recursion
Like all other functions, the recursive function‟s data is stored in the stack memory in the form of a stack
frame. This stack frame is deleted once the function returns some value. In recursion,
 The function call is made before returning the value, so the stack frame for the progressive recursive
calls is stored on top of existing stack frames in the stack memory.
 When the topmost function copy returns some value, its stack frame is destroyed and the control
comes to the function just before that particular copy after the point where the recursive call was made
for the top copy.
 The compiler maintains an instruction pointer to track where to return after the function execution.
Let‟s consider the above example and understand the memory management of nSum(5) function.
Step 1: When nSum() is called from the main() function with 5 as an argument, a stack frame for
nSum(5) is created.

Call Stack at Step 1

Step 2: While executing nSum(5), a recursive call is encountered as nSum(4). The compiler will now
create a new stack frame on top of the nSum(5)‟s stack frame and maintain an instruction pointer at the
statement where nSum(4) was encountered.

Call Stack at Step 2


Step 3: The execution of nSum(4) will start, but just like the previous function, we encounter another
recursive call as nSum(3). The compiler will again follow the same steps and maintain another
instruction pointer and stack frame for nSum(3).

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 7


Call Stack at Step 3
Step 4: The same thing will happen with nSum(3), nSum(2), and nSum(1)‟s execution.
Step 5: But when the control comes to nSum(0), the condition (n == 0) becomes true and the
statement return 0 is executed.

Call Stack at Step 5


Step 6: As the value is returned by the nSum(0), the stack frame for the nSum(0) will be destroyed, and
using the instruction pointer, the program control will return to the nSum(1) function and the nSum(0)
call will be replaced by value 0.

Call Stack at Step 6


Step 7: Now, in nSum(1), the expression int res = 1 + 0 will be evaluated and the statement return
res will be executed. The program control will move to the nSum(2) using its instruction pointer.

Call Stack at Step 7


Step 8: In nSum(2), nSum(1) call will be replaced by the value it returned, which is 1. So, after
evaluating int res = 2 + 1, 3 will be returned to nSum(3). Same thing will keep happening till the
control comes to the nSum(5) again.

Call Stack at Step 8

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 8


Step 9: When the control reaches the nSum(5), the expression int res = 5 + nSum(4) will look
like int res = 5 + 10. Finally, this value will be returned to the main() function and the execution of
nSum() function will stop.

Call Stack at Step 9


What is Stack Overflow?
Stack overflow is one of the most common errors associated with the recursion which occurs when a
function calls itself too many times. As we know that each recursive call requires separate space in the
limited stack memory. When there is a large number of recursive calls or recursion goes on infinite
times, this stack memory may get exhausted and may not be able to store more data leading to
programs‟ termination.

Tower of Hanoi
Tower of Hanoi, is a mathematical puzzle which consists of three towers (pegs) and more than one
rings is as depicted −

These rings are of different sizes and stacked upon in an ascending order, i.e. the smaller one sits over
the larger one. There are other variations of the puzzle where the number of disks increase, but the
tower count remains the same.
Rules
The mission is to move all the disks to some another tower without violating the sequence of
arrangement. A few rules to be followed for Tower of Hanoi are −
 Only one disk can be moved among the towers at any given time.
 Only the "top" disk can be removed.
 No large disk can sit over a small disk.
Following is an animated representation of solving a Tower of Hanoi puzzle with three disks.

Tower of Hanoi puzzle with n disks can be solved with minimum 2n-1 steps.

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 9


Lab Assignments

Date : / /

Set A
a) Write a program to read a number from user. Write recursive function to find
factorial of that number.

b) Write a program to read number of terms. Write a recursive function to print the
Fibonacci Series upto number of terms.

c) Write a program to read number of disks in Tower of Hanoi. Write a recursive


function to print the steps to solve the tower of Hanoi problem.

Set B

a) Write a program to read two numbers from user. Write recursive function to find GCD of
that numbers.

b) Write a program to read a number from user. Write a recursive function to find the sum
of digits of a number.

c) Write a program to read a number from user. Write a recursive function to calculate the
sum of numbers from 1 to n.

Set C

a) Implement a recursive binary search algorithm to find a target value in a sorted array.

b) Implement the N-Queens problem using recursion, where the task is to place N queens on
an NxN chessboard such that no two queens threaten each other.

Assignments Evaluation:

0: Not Done [ ] 1: Incomplete[ ] 3: Late Complete [ ]

4: Need to improvement [ ] 5: Completed [ ]

Signature of Instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 10


Assignment 2 : Queue

Objectives
 To learn queue data structure.

 To learn queue operations.

Reading
You should read the following topics before starting this exercise
 About queue operations.
 Different queue types.

Ready Reference
Queue is an ordered set of elements in which insertions are done from the rear and deletions are done from the
front. It is a First in First Out ( F I F O ) structure.

Types of Queue :
1. Linear Queue : In this queue elements are arranged in a sequential manner such that front position is
always less than or equal to rear position.

2. Circular Queue : In this queue , front and rear increment circularly. The elements are arranged in a
sequential manner but can logically be regarded as arranged circularly.

3. Priority Queue : In this queue , the elements are arranged according to their priority. The queue
operations are performed according to the priority of the elements.

4. Double Ended Queue : In this type of queue , the queue operations namely Add and Remove can be
performed from both the ends. Thus this queue supports four basic operations.

1. Static Implementation

A Queue is implemented statically by using an array of size MAX to hold stack elements and two integers –
front and rear. The „front‟ stores the position of the current front element and „rear‟ stores the position of the
current rear element of the queue. A queue is a single entity that is a class made up of the array, rear and front.
The Queue elements can be integers, characters, strings or user defined types.

The operations to be performed on a Queue are-

 init (Q) – Create an empty queue by initializing both front and rear to -1 indicating the queue is empty
 add (Q, x) – adding an element x to the rear end of the queue Q
 delete (Q) – deletes the element from the front of the queue Q

 peek (Q) - returns the front element from the queue without deleting the element from the Queue
 isEmpty (Q) – check if the queue is empty, that is, when rear equals front
 isFull (Q) – check if the Queue is full which happens when rear equals MAX -1

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 11


3. Dynamic Implementation

A Queue is implemented dynamically by using a Linked list where each node in the linked list has two parts,
the data element and the pointer to the next element of the queue. Since Queue should be a single entity, we
need to use only one external pointer while here we need two one for rear and one to the front. To avoid this we
use a circular linked list and Queue pointer is pointing to the rear of the queue. Front can be easily accessed as
it is next to rear. The Queue elements can be integers, characters, strings or user defined types. There is no
restriction on how big the Queue can grow.

The operations to be performed on a Queue

init (Q) – Create an empty queue as a circular linked list by initializing S to NULL indicating that the queue is
empty

add (Q, x) – Adding an element x to the queue Q requires creation of node containing x and putting it next
to the rear and rear points to the newly added element. This changes the rear pointer Q and the function should
return the changed value of Q. The function call will be as follows

Q=add(Q, x);
delete (Q) – deletes the front node from the queue Q which is actually next element to the
rear pointer Q. However if queue contains only one element, (Q->next == Q) then deleting this single
element can be achieved by making empty Q (Q =NULL). Since the rear pointer Q is changed in this case,
function should return the changed value of Q. The function call will be as follows

Q=delete(Q);

peek (Q) - returns the data element in the front (Q->next) node of the Queue Q.

isEmpty (Q) – Check if the Queue is empty which is equivalent to checking if Q==NULL

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 12


Lab Assignments
Date : / /
Set A

a) Implement a queue of integers using a static implementation of the queue and implementing
the above six operations. Write a menu driven program that calls different queue functions.
b) Implement a queue of integers using a dynamic implementation of the queue and
implementing the above five operations. Write a menu driven program that calls different
queue functions.

Set B
a) A statically implemented queue may become full even if the initial positions in the array are
unoccupied. To avoid this situation, a wrap around can be attempted and initial positions
reused. The array can be treated as if it were circular. This can be implemented making use
of mod function. Implement a queue library (cstqueue.h) of integers using a static
implementation of the circular queue and implementing the above six operations.
b) A doubly ended queue allows additions and deletions from both the ends that is front and
rear. Initially additions from the front will not be possible. To avoid this situation, the array
can be treated as if it were circular. Implement a queue library (dstqueue.h) of integers
using a static implementation of the circular queue and implementing the seven operations
init(Q), isempty(Q), isFull(Q), addFront(Q,x), deleteFront(Q), addRear(Q,x) and
deleteRear(Q) .

Set C
a) Implement a priority queue, where each element has a priority and elements are dequeued in
order of priority rather than arrival time.
b) Implement a queue using two stacks.
c) Implement undo and redo functionality using two queues. One queue will hold the "undo"
history, and another will hold the "redo" history.

Assignment Evaluation :

0 : Not done 1 : Incomplete 2 : Late Complete

3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 13


Assignment 3 : Tree

Objectives
 To learn tree as a data structure.
 To implement tree techniques.

Reading
You should read the following topics before starting this exercise
 About tree concept.
 Tree traversal techniques.

Ready Reference
Tree is a recursive data structure. A Binary tree consists of a root and two disjoint binary trees
called left and right trees. In Binary search tree every element is distinct and elements in the
left subtree are smaller than the root and root is smaller than elements in right subtree.

The operations on binary search tree are

init (T) – creates an empty Binary search tree by initializing T to NULL

insert (T, x) – inserts the value x in the proper position in the Binary search tree

search (T, x) – searches if the value x is present in the search tree

inOrder (T) – displays the node using inorder traversal of binary search tree

postOrder (T) – displays the node using postorder traversal of binary search tree

preOrder (T) – displays the node using preorder traversal of binary search tree.

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 14


Lab Assignments

Date : / /
Set A

a) Implement a Binary search tree library ( btree.h) with above six operations. Write a menu
driven driver program to call the above functions

Set B

a) Write a program which uses Binary search tree library and implements two more functions.

Create(T, n) – inserts n nodes in the Binary search tree where the values are either
accepted from user or randomly generated (use insert)

Count(T) – returns the number of nodes in the tree

Set C

a) How Count(T) function can be modified instead to count leaf nodes in the tree?

b) Write a delete(T, x) which deletes the node containing data element x if and only if it is a
leaf node.

c) What is the strategy to implement delete operation in case of a non leaf node?

d) How to obtain a mirror image of a binary search tree?

e) How to find the minimum element in a Binary search tree? How to find the maximum element in a
Binary search tree?

Assignment Evaluation:

0 : Not done 1 : Incomplete 2 : Late Complete


3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 15


Assignment 4: Graph

Objectives

 To learn graph as a data structure.


 To implement graph traversal techniques.

Reading

You should read the following topics before starting this exercise
 About graph concept.

 Graph traversal techniques.

Ready Reference
A graph consists of a set of vertices and a set of edges. The two main ways of representing graphs are
adjacency matrix representation and adjacency list representation.

In adjacency matrix representation of a Graph with n vertices and e edges, a two dimensional nxn array ,
say a , is used , with the property that a[i,j] equals 1 if there is an edge from i to j and a[i,j] equals 0 if
there is no edge from i to j.

In adjacency list representation of a graph with n vertices and e edges, there are n linked lists, one list for
each vertex in the graph.

The usual operations on graph are:

Indegree(i) – returns the indegree (the number of edges ending on) of the ith vertex

Outdegree(i) – returns the outdegree(the number of edges moving out) of the ith vertex)

displayAdjMatrix – displays the adjacency matrix for the graph

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 16


Lab Assignments

Set A

a) Write a program that accepts the vertices and edges for a graph and stores it as an
adjacency matrix. Implement functions to print indegree, outdegree and to display the
adjacency matrix.

b) Write a program that accepts the vertices and edges for a graph and stores it as an
adjacency list. Implement functions to print outdegree of any vertex i.

Set B

a) Write a program that accepts the graph as an adjacency matrix and converts it to adjacency
list representation. Write a function to display the graph in adjacency list form.

b) Write a program that accepts the graph as an adjacency matrix and checks if the graph is
undirected. The matrix for undirected graph is symmetric

Set C

a) What can be concluded about the directed graph if there is no vertex with indegree zero?

b) In the adjacency list representation the dummy head node of each linked list can be used
to store the indegree of the vertex when the adjacency list is created. Modify the program
so that every time an edge node is added to the list the head node entry is incremented.
Write a function to print indegree of vertex i.
c) A graph may not have an edge from a vertex back to itself(self-edges or self-loops). Given
an adjacency matrix representation of a graph, how to know if there are self-edges?

Date : / /
Assignment Evaluation :

0 : Not done 1 : Incomplete 2 : Late Complete

3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 17


PART – B : Advanced Web Technology

Assignment Completion Sheet

Marks Teacher
Sr. No Assignment
(out of 5) Sign
1. Assignment 1

2. Assignment 2

3. Assignment 3

4. Assignment 4

5. Assignment 5

6. Assignment 6

7. Assignment 7

8. Assignment 8

Total (out of 40)

Total (out of 10)

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 18


Assignment 1
Lab Assignments

Date : / /

Set A

1. Create a basic web page of your own videos that will contain any three good video clips.

2. Create a basic webpage which will contain any three audio songs of God to play.

Set B

1. Create a basic webpage which will contain any two YouTube Motivational videos.

2. Create a basic webpage which will contain any two YouTube Movie videos.

Set C

1. Create a custom audio player with play, pause, and volume control functionality.

2. Create a custom video player with controls for play, pause, and adjusting playback speed.

Assignment Evaluation:

0 : Not done 1 : Incomplete 2 : Late Complete


3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 19


Assignment 2
Lab Assignments

Date : / /
Set A

1. Download or Create collage picture of three fruits images. When you click on particular
fruit, it must display information of that particular fruit on web page. (use image mapping)

2. Download and Create collage picture of all Seven Wonders of the World. When you click
on particular wonder image, it must display information of that particular wonder. (use
image mapping)

Set B

1. Create a picture in paint brush consisting of three squares. Insert this picture on webpage.
Create image map such that when you click on first square it should display web page of
Tuljaram Chaturchand college, Baramati. When you click on second square it should
display “Gallery” web page of Tuljaram Chaturchand college, Baramati. When you click
on third square it should display “Activities” web page of Tuljaram Chaturchand college,
Baramati. (use image mapping)

2. Download or Create collage picture of parts of computer images. When you click on
particular computer part, it must display information of that particular part on web page.
(use image mapping)

Set C
1. Download and Display Maharashtra.jpg image on web page consisting of different
Districts. Once click on any district, it should open new web page consisting of
information about the tourist spots in particular district.

2. Download and Display India.jpg image on web page consisting of different states. Once
click on any state, it should open new web page consisting of information about that state.

____________________________________________________________________________

Assignment Evaluation:

0 : Not done 1 : Incomplete 2 : Late Complete


3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 20


Assignment 3
Lab Assignments

Date : / /

Set A

1. Write an HTML5 Canvas program to draw a smiley face.

2. Write an HTML5 Canvas program to implement Gradient Fill. Create a rectangle with a
gradient fill.

Set B

1. Write an HTML5 Canvas program to draw a Temple.

2. Write an HTML5 Canvas program to create a triangle with a gradient fill.

Set C
1. Create an animation of a ball bouncing within the canvas.
2. Create a canvas and allow the user to draw rectangles by clicking and dragging on the canvas.

________________________________________________________________________

Assignment Evaluation:

0 : Not done 1 : Incomplete 2 : Late Complete


3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 21


Assignment 4
Lab Assignments

Date : / /

Set A

1. Write an SVG program to draw a simple house using rectangles, triangles, and a circle.

2. Write an SVG program to draw a circle filled with a radial gradient.

Set B

1. Write an SVG program to create a SVG animation where a circle changes its color
continuously.

2. Write an SVG program to create a SVG animation of a square rotating around its center.

Set C

1. Write an SVG program to draw a flower with a circular center and six petals.

2. Write an SVG program to create an SVG rectangle that changes color when clicked.

Assignment Evaluation:

0 : Not done 1 : Incomplete 2 : Late Complete


3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 22


Assignment 5
Lab Assignments

Date : / /

Set A

1. Write a CSS transition code to create a button that changes its background color when
hovered over.

2. Write a CSS transition code to create a box that grows in size when hovered over.

Set B

1. Write a CSS transition code to create a square that rotates when hovered
over.
2. Write a CSS transition code to create a circle that moves smoothly to the right when hovered
over.

Set C

1. Create a navigation menu where items change color and underline smoothly when hovered
over. ( Use CSS Transitions)

2. Build an image gallery where images smoothly zoom in when hovered over. ( Use CSS
Transitions)

__________________________________________________________________________

Assignment Evaluation:

0 : Not done 1 : Incomplete 2 : Late Complete


3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 23


Assignment 6

Lab Assignments

Date : / /

Set A

1. Write a CSS animation code to create a box that moves horizontally across the screen.

2. Write a CSS animation code to create text that changes its color continuously.

Set B

1. Write a CSS animation code to create a circle that grows and shrinks continuously.

2. Write a CSS animation code to create a square that rotates continuously.

Set C

1. Write a CSS animation program to create text that slides from left to right continuously.

2. Write a CSS animation program to create text that fades in and out continuously.

_______________________________________________________________

Assignment Evaluation:

0 : Not done 1 : Incomplete 2 : Late Complete


3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 24


Assignment 7
Lab Assignments

Date : / /

Set A

1. Write a JavaScript program to check if a given number is even or odd.

2. Write a JavaScript program to calculate the factorial of a number using a for loop.
Set B

1. Write a JavaScript program to print the multiplication table of a number using a while
loop.

2. Write a JavaScript program to display the day of the week based on a number input (1 for
Monday, 7 for Sunday).
Set C
1. Write a JavaScript program to accept seat number, total marks scored and number of
subjects from user and display grade for the specified student.

2. Write a JavaScript program which display three buttons for alert, prompt and confirm. If
the alert button is clicked, program should display “This is alert box” message. If the
confirm button is clicked, program should display confirm box and if OK button is clicked
it should display “You pressed OK!” or if Cancel button is clicked it should display “You
pressed Cancel!”. If the prompt button is clicked, it should ask about user input displaying
“Please enter your name”, after clicking the OK button it should display a message
including user specified name.

Assignment Evaluation:

0 : Not done 1 : Incomplete 2 : Late Complete


3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 25


Assignment 8
Lab Assignments

Date : / /

Set A

1. Write a JavaScript program to create a button that changes the text content of a paragraph
when clicked.

2. Write a JavaScript program to change the background color of a box when the mouse
hovers over it and reset it when the mouse leaves.
Set B

1. Write a JavaScript program to display the key pressed by the user in real-time.

2. Write a JavaScript program to validate a form to ensure the input field is not empty before
submission.

Set C
1. Write a JavaScript program to accept username and password from the user. If either the
username or the password is blank, then display "User Name or Password cannot be
empty!". If the length of username is less than 6 or the length of username is greater than
15, display "User Name: between 6 to 15". If the length of password is less than 8 or the
length of password is greater than 20, then display "Password: between 8 to 20" (Use
onsubmit event, alert)

2. Write a JavaScript program which displays content in paragraph in blue colour. When
mouse button is clicked over the paragraph, text color changes to red and when mouse
button is released, text color changes back to blue (Hint: Use onmouseup and
onmousedown events)

Assignment Evaluation:

0 : Not done 1 : Incomplete 2 : Late Complete


3 : Needs improvement 4 : Complete 5 : Well Done

Signature of the instructor

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 26


Question Paper Format

Total Marks 50

A) Internal : 25 Marks

Internal Evaluation Exam Format:


Q.1. Data Structure Program : 10 Marks
Q.2. Web Technology Program : 10 Marks
Q.3. Notebook & Performance : 05 Marks

B) External : 25 Marks

External Practical Exam Paper Format:


Q.1. Data Structure Program : 10 Marks
Q.2. Web Technology Program : 10 Marks
Q.3. Viva and Workbook : 05 Marks

SYBSc(CS)Workbook As Per NEP 2023 Pattern(NEP1.0) Page 27

You might also like