0% found this document useful (0 votes)
60 views20 pages

DCCN - Lab Mannual - Updated

Uploaded by

umamaheswarivcse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views20 pages

DCCN - Lab Mannual - Updated

Uploaded by

umamaheswarivcse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Laboratory Manual

DEPARTMENT OF COMPUTER SCIENCE AND


ENGINEERING

PROGRAM - B.E
OBJECT ORIENTED PROGRAMMING (22CSC04)
(Common for CSE, CSE-AI&ML, CSE-IoT, AI&ML, IT, AI&DS)
SEMESTER - II

R-22 Regulation

Prepared by: …………………………………. Verified by: ……………………………

1|Page
CHAITANYA BHARATHI INSTITUTE OF TECHNOLOGY
(An Autonomous Institution, Affiliated to Osmania University, Approved by AICTE,
Accredited by NAAC with A++ Grade and Programs Accredited by NBA)
Chaitanya Bharathi Post, Gandipet, Kokapet (Vill.), Hyderabad, Ranga Reddy - 500 075, Telangana
www.cbit.ac.in

2|Page
CHAITANYA BHARATHI INSTITUTE OF TECHNOLOGY
(An Autonomous Institution, Affiliated to Osmania University, Approved by AICTE,
Accredited by NAAC with A++ Grade and Programs Accredited by NBA)
Chaitanya Bharathi Post, Gandipet, Kokapet (Vill.), Hyderabad, Ranga Reddy - 500 075, Telangana
www.cbit.ac.in
DEPARTMENT OF ……………………………………………….

Name of the Lab Course:


OBJECT-ORIENTED PROGRAMMING LAB (22CSC04)
INDEX
Item Page No
Institute Vision, Institute Mission, Quality Policy, Department Vision and
2
Department Mission
Program Educational Objectives (PEOs), Program Outcomes (POs) and
3
Program Specific Outcomes (PSOs)
Syllabus 7
Course Introduction 8
Assessment Procedure of CIE and SEE 9-10
General Instructions for Laboratory Classes 11
Concluding Remarks / Gap Analysis 16

LABORATORY / PRACTICAL
Page
Exp No Laboratory / Practical CO BTL
No
1 Study of Network media, cables, and devices and Cable Construction.
1 L3 12-15
2 Demonstration of basic network commands/utilities (both in Windows and
Linux).
3 PC Network Configuration.

4 Building a switch-based network / Configuration of Cisco Switch CBS250-


24T-4G 24-Port.
5 Configuration of Cisco Router ISR-4331.

6 Configuration of VLAN in Cisco switch.

7 Develop different local area networks using GNS3. Connect two or more Local
area networks. Explore various sub-netting options.
8 Configure Static routing using GNS3 tool.

9 Basic OSPF configuration using GNS3 tool.

3|Page
10 Basic EIGRP Configuration using GNS3 tool.

11 Analysis of network traces using tcpdump.

12 Analysis of network traces using Whireshark.

Experiments Beyond curriculum (Code development)


1 Write a Python program for demonstrating the use of lits, tuples, sets
and dictionaries
2 Write a Python program for implementation of classes with attributes
and methods
3 Write a Python program for demonstration of various types of
inheritance
4 Write a Python program for demonstration of
a) Composition and aggregation
b) Unit testing
c) Exceptions

Note:
a) Minimum 12 experiments should be included in every course other than experiments beyond
syllabus.
b) Add project/ case studies/ student defined experiments for the courses having experiments
less than 12 in syllabus.
c) Include Minimum 2 experiments beyond prescribed experiments meeting industry problems to
challenge student learning.

4|Page
CHAITANYA BHARATHI INSTITUTE OF TECHNOLOGY
(An Autonomous Institution, Affiliated to Osmania University, Approved by AICTE,
Accredited by NAAC with A++ Grade and Programs Accredited by NBA)
Chaitanya Bharathi Post, Gandipet, Kokapet (Vill.), Hyderabad, Ranga Reddy - 500 075, Telangana
www.cbit.ac.in

Vision of Institute
To be the Centre of Excellence in Technical Education and Research.

Mission of Institute
To address the Emerging needs through Quality Technical Education
and Advanced Research.

Quality Policy
CBIT imparts value based Technical Education and Training to meet
the requirements of students, Industry, Trade/ Profession, Research
and Development Organizations for Self-sustained growth of Society.

5|Page
CHAITANYA BHARATHI INSTITUTE OF TECHNOLOGY
(An Autonomous Institution, Affiliated to Osmania University, Approved by AICTE,
Accredited by NAAC with A++ Grade and Programs Accredited by NBA)
Chaitanya Bharathi Post, Gandipet, Kokapet (Vill.), Hyderabad, Ranga Reddy - 500 075, Telangana
www.cbit.ac.in
DEPARTMENT OF ……………………………………………….

Vision of the Department


-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------

Mission of the Department

-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------

Program Educational Objectives (PEOs)

-----------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------

6|Page
CHAITANYA BHARATHI INSTITUTE OF TECHNOLOGY
(An Autonomous Institution, Affiliated to Osmania University, Approved by AICTE,
Accredited by NAAC with A++ Grade and Programs Accredited by NBA)
Chaitanya Bharathi Post, Gandipet, Kokapet (Vill.), Hyderabad, Ranga Reddy - 500 075, Telangana
www.cbit.ac.in
DEPARTMENT OF ……………………………………………….

Program Outcomes (POs)


PO1.
------------------------------------------------------------------------------
PO2. -----------------------------------------------------------------------------

PO3. -----------------------------------------------------------------------------

PO4. -----------------------------------------------------------------------------

PO5. -----------------------------------------------------------------------------

PO6. -----------------------------------------------------------------------------

PO7. -----------------------------------------------------------------------------

PO8. -----------------------------------------------------------------------------

PO9. -----------------------------------------------------------------------------

PO10. -----------------------------------------------------------------------------

PO11. -----------------------------------------------------------------------------

PO12. -----------------------------------------------------------------------------

Program Specific Outcomes (PSOs)


PSO1. -----------------------------------------------------------------------------

PSO2. -----------------------------------------------------------------------------

PSO3. -----------------------------------------------------------------------------

7|Page
22CSC04
OBJECT-ORIENTED PROGRAMMING LAB
Instruction 0L-0T-2P
Duration of SEE 3 Hours
SEE 60 Marks
CIE 40 Marks
Credits 1

Course Objectives: The objectives of this course are to:


1. Master the concepts of Object Oriented Programming.
2. Explore the OOPs features of Python and build applications.

Course Outcomes: After completion of course, students would be able to:


1. Demonstrate the features of Object-Oriented Programming.
2. Understand APIs and third-party libraries to be used with Python.
3. Use Python libraries to solve real-world problems.
4. Write scripts to solve data science/machine leaning problems using NumPy and Pandas.
5. Develop applications by accessing web data and databases.

Laboratory / Practical:
1. Write a NumPy program to compute the cross product of two given vectors.
2. Write NumPy program to calculate the QR decomposition of a given matrix.
3. Write a Pandas program to convert a Panda Module Series to Python list and its type.
4. Write a Pandas program to convert a NumPy array to a Pandas series.
5. Create a Python project to get the citation from Google scholar using title and year of
publication and volume and pages of journal.
6. Create a Python project to get total COVI-19 cases, total deaths due to Covid-19, total Covid-19
patients recovered in the world.

Text Book:
1. Reema Thareja, "Python Programming”, Oxford Press, 2017.

Online Resources:
1. https://vknight.org/cfm/labsheets/04-object-oriented-programming/
2. http://learning-python.com/class/Workbook/x-exercises.htm
3. https://inst.eecs.berkeley.edu/~cs61a/fa14/lab/lab06/#inheritance
4. https://anandology.com/python-practice-book/object_oriented_programming.html
5. http://stanfordpython.com/
6. https://docs.python.org/3/

Course Articulation Matrix:

CO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO1
CO2
CO3
CO4
CO5
Avg

8|Page
COURSE INTRODUCTION

Name of the Lab Course:


OBJECT-ORIENTED PROGRAMMING LAB (22CSC04)
Object-Oriented Programming (OOP) is a programming paradigm that revolves around the
concept of "objects." It allows developers to model real-world entities as objects, each having its
own data (attributes) and behavior (methods). Python is a versatile and powerful programming
language that fully supports OOP principles, making it an excellent choice for learning and
applying OOP concepts.
The Object-Oriented Programming Lab using Python is a hands-on learning environment
where students or developers can gain practical experience in creating, implementing, and using
classes, objects, inheritance, polymorphism, encapsulation, and other OOP concepts. The lab
provides a platform for learners to build robust, scalable, and maintainable software solutions by
leveraging the power of OOP.
Applications of Object-Oriented Programming Lab using Python:
1. Software Development: OOP allows developers to structure their code into reusable and
modular components. In the lab, students can learn how to design and implement classes to
represent various entities within a software application. This approach simplifies code
maintenance and promotes collaboration among team members.
2. Game Development: Creating games often involves managing multiple objects with
distinct properties and behaviors. In the lab, learners can develop interactive games by
defining classes for characters, items, levels, etc., and implementing game mechanics using
OOP principles.
3. Graphical User Interface (GUI) Development: Python offers popular GUI libraries like
Tkinter and PyQt that rely heavily on OOP concepts. In the lab, students can build graphical
applications, design user interfaces, and handle events using the principles of OOP.
4. Data Modeling and Analysis: OOP is useful for representing and manipulating real-world
data. In the lab, learners can practice building classes to model data structures, create
custom data types, and perform data analysis tasks.
5. Web Development: While Python is not the most common language for web development,
it is still used in some cases, and OOP principles can be applied to web applications. In the
lab, students can learn how to design web frameworks and build web applications with
Python using OOP techniques.
6. Automation and Scripting: OOP can improve the structure and organization of automation
scripts. In the lab, learners can create classes that encapsulate functionality and create more
maintainable and extensible automation scripts.
7. Robotics and IoT: For projects involving robots or IoT devices, OOP can provide an
effective way to model the devices' behavior and interactions. In the lab, students can
experiment with programming robots or IoT devices using Python's OOP capabilities.

9|Page
ASSESSMENT PROCEDURE AND AWARD OF CIE

MARKS

Following is the subdivision for the internal marks (50) of the Lab:

(i) 20 marks for the lab internal tests

Two tests are to be conducted i.e one test after 1st cycle of experiments and second
test after the second cycle. Average of two tests marks put together should be
consider (20 maximum)

(ii) 30 marks for CIE

For the CIE 30 marks will be awarded based on the rubrics provided below.

This Rubrics are general guideline. Based on the lab type (programming or hardware) and
complexity of the course Rubrics can be customized by the department in tune to program and
course offered. Performance Indicators of the Rubrics also can be changed by the
departments/Program based on the need.
RUBRICS
S. Descriptors and Score
Parameter
No Outstanding Good Fair Poor Very Poor
1 Pre- Well prepared prepared for Adequately Minimal Lacks
Experiment for the the prepared for the preparation preparation
Preparation experimentatio experimentatio experimentation and without and without
work n with a clear n with clear without clear clear clear
5M specifications, specifications specifications specifications specifications
plan/design and and and and
and additional plan/design plan/design plan/design plan/design (1
information (4M) (3M) (2M) M)
(5M)
2 Experimentati Student Student solves Student solves Student solves Student fails
on (Problem conducts the problem the problem and the problem to solve the
Solving, experiment and conducts conducts with few test problem (2M)
Methodology with all experiments experiment with cases with
of possible test with all few possible test complexity
Conduction) cases in an possible test cases with (4M)
10 M optimized cases (8M) complexity (6M)
fashion.(10M)
3 Post Demonstrates Demonstrates Demonstrates Demonstrates Failed to
Experiment the results and results and Partial results Demonstrates
Analysis simulation/ inference; inference; and inference; results and
[Viva, findings Able to answer Unable to Unable to inference;
Inference] /Hardware Few Questions answer the answer the Unable to
5M results Infers posed by Questions Questions answer the
and answer all Instructor (4M) posed by posed by Questions
the Questions Instructor. (3M) Instructor (2M) posed by
posed by Instructor
Instructor (1M)
(5M)
4 Report Report meets Report with Report is Report is Report is

10 | P a g e
S. Descriptors and Score
Parameter
No Outstanding Good Fair Poor Very Poor
Writing all well-organized complete and complete, poor incomplete,
5M requirements content, adequate with grammar and unclear, poor
and it is visuals, poor grammar. inadequate and grammar and
prepared in graphics, (3M) failed to inadequate
original and citations and organize (1M)
creative way to references (4M) thoughts (2M)
engage readers
(5M)
5 Conduct Excellent team Follows the Follows safety Followed Does not
(Ethics, spirit, strictly safety precautions and minimum Follows safety
Safety, Team follows ethics precautions, ethical practices safety precautions
Work) 5M and safety practices ethics and failed to precautions and ethical
precautions and poor team exhibit and ethical practices and
with good work (4M) teamwork. practices and failed to
team work (3M) failed to exhibit exhibit team
(5M) team work. work. (1M)
(2M)
TOTAL SCORE

11 | P a g e
ASSESSMENT PROCEDURE AND AWARD OF SEE

MARKS

S. Descriptors and Score


Parameter
No. Outstanding Good Fair Poor Very Poor
1 Record The content of all The content of The content The content of The content
5M the experiments is most of the of the most of the few of the all the
well-organized, experiments are experiments experiments is experiments
recorded the well-organized, are well- not well- is not well-
tables and neatly recorded the organized, organized, organized,
drawn graphs. tables, neatly recorded the recorded the recorded the
Results and drawn graphs. tables, neatly tables, neatly tables, neatly
discussions are Results and drawn drawn graphs. drawn
well presented. discussion are graphs. Results and graphs.
(5M) presented. (4M) Results and discussion are Results and
discussion are not presented discussion
not presented (2M) are not
(3M) presented
(1M)
2 Write up Presentation of Presentation of Presentation Presentation Presentation
about the the given the given of the given of the given of the given
experiment experiment/progr experiment/pro experiment/p experiment/pr experiment/
10M am is very well gram is rogram is ogram is program is
organized with organized with organized minimal with minimum
the required the required and is clear without
content, content, without clear specifications clear
specifications, specifications, specifications and specification
plan/procedure of plan/procedure and plan/design. s and
the conduct and of the conduct. plan/design. (4M) plan/design.
all the required (8M) (6M) (2M)
additional
information.
(10M)
3 Conduction Conducts Conducts Conducts Conducts Failed to
of the experiment / experiment / experiment / experiment / Conducts
experiment Simulate the Simulate the Simulate the Simulate the experiment
and problem with problem with problem with problem with / Simulate
observation proper connections / proper improper the problem
s connections / all with most of the connections / connections / with
15M possible test cases. test cases. Failed less test cases. less test cases. improper
All the possible to note all (9M) (6M) connections
observations are observations / less test
noted. (15M) (12M) cases. (3M)
4 Results & Demonstrates the Demonstrates Demonstrates Demonstrates Failed to
Analysis experimental the experimental the the partial Demonstrate
10M results with results with experimental experimental the results
adequate required analysis results, failed results with and least
analysis / / simulation/ to maximum least analysis / analysis /
simulation/ findings analysis / simulation/ simulation/
findings /obtained simulation/ findings. findings.
/obtained results /plotting findings. (4M) (2M)
results /plotting the graphs. (8M) (6M)
the graphs. (10M)
5 Viva-Voce Answers most of Answers most of Answers only Answers only Failed to
12 | P a g e
S. Descriptors and Score
Parameter
No. Outstanding Good Fair Poor Very Poor
10M the questions with the questions few of the few of the answer
good analytical with good questions questions with questions.
explanation. explanation. with good nominal (2M)
(10M) (8M) explanation. explanation.
(6M) (4M)
TOTAL SCORE

13 | P a g e
GENERAL INSTRUCTIONS FOR LABORATORY CLASSES

DO‘S
1. Without Prior permission do not enter into the Laboratory.
2. While entering into the LAB students should wear their ID cards.
3. The Students should come with proper uniform.
4. Students should sign in the LOGIN REGISTER before entering into the laboratory.
5. Students should come with observation and record note book to the laboratory.
6. Students should maintain silence inside the laboratory.
7. After completing the laboratory exercise, make sure to shutdown the system properly

DONT‘S
1. Students bringing the bags inside the laboratory.
2. Students wearing slippers/shoes insides the laboratory.
3. Students using the computers in an improper way.
4. Students scribbling on the desk and mishandling the chairs.
5. Students using mobile phones inside the laboratory.
6. Students making noise inside the laboratory.

14 | P a g e
EXPERIMENT / PRACTICAL -1
Write a NumPy program to compute the cross product of two given vectors

OBJECTIVE OF THE EXPERIMENT:


The objective of the Python program is to compute the cross product of two given vectors
using the NumPy library. The cross product is a vector operation that produces a new vector
perpendicular to the two input vectors in three-dimensional space.

OUTCOME OF THE EXPERIMENT:


The outcome of the Python program to compute the cross product of two given vectors using
NumPy will be the resulting cross product vector. The cross product vector is a new vector
that is perpendicular to both input vectors in three-dimensional space.

Here's a step-by-step explanation of the outcomes of the Python program:


1. Input: The program will prompt the user to provide the two vectors as input. These
vectors can be entered as lists of three numbers, representing the x, y, and z
components of each vector.
2. NumPy Integration: The program will use the NumPy library to perform the cross
product operation efficiently. NumPy provides the cross function, which takes two
arrays as input and returns their cross product.
3. Vector Calculation: The program will calculate the cross product of the two input
vectors using the NumPy cross function.
4. Output: The program will display the resulting cross product vector as output.

The outcome of the Python program will be the resulting cross product vector, which
represents the direction and magnitude of the cross product of the two given vectors. The
cross product has various applications in physics, engineering, and computer graphics.

SYSTEM REQUIREMENTS:
To run a NumPy program that computes the cross product of two given vectors, you need to
ensure that your system meets the following requirements:

1. Python: Make sure you have Python installed on your system. NumPy works with both
Python 2 and Python 3, but it is recommended to use Python 3 as Python 2 is no longer
supported.
2. NumPy: Install the NumPy library. You can do this using the package manager pip.
Open a command prompt (or terminal) and run the following command:

pip install Numpy

This will install the latest version of NumPy on your system.

3. Text Editor or Integrated Development Environment (IDE): You need a text editor or
IDE to write and edit your Python code. Popular choices include Visual Studio Code,
PyCharm, Sublime Text, Atom, and IDLE (comes bundled with Python).
4. Operating System: Python and NumPy are compatible with various operating systems
like Windows, macOS, and Linux. So, ensure that your system is running one of these

15 | P a g e
supported operating systems.
5. Hardware Requirements: Python and NumPy are lightweight and don't have
significant hardware requirements. Any modern computer with sufficient memory and
processing power should be capable of running Python programs, including those
using NumPy.

Once your system meets these requirements, you can create a Python file (e.g.,
cross_product.py) and write the NumPy program to compute the cross product of two given
vectors, as shown in the previous procedure. Save the file and run it using the Python
interpreter in the command prompt or IDE.

For example, if you are using the command prompt or terminal, navigate to the directory
where your cross_product.py file is located and run the following command:

python cross_product.py
If everything is set up correctly, the program will execute, and you should see the output
displaying the cross product of the given vectors.

ALGORITHM / PROCEDURE:
Here's a step-by-step procedure to write a NumPy program that computes the cross product
of two given vectors:
Step 1: Import the NumPy library.
Step 2: Define a function that takes two vectors as input and computes their cross product.
Step 3: Convert the input vectors into NumPy arrays.
Step 4: Use the NumPy cross function to calculate the cross product of the two vectors.
Step 5: Return the result of the cross product.
Step 6: In the main part of the program, provide the input vectors to the function.
Step 7: Display the result obtained from the function.

Note: To run the program, you need to have NumPy installed in your Python environment. If
you don't have it installed already, you can install it using pip:

pip install numpy

PSEUDOCODE:
Below is the Python pseudo-code to compute the cross product of two given vectors using
NumPy:

# Import the NumPy library


import numpy as np

# Function to compute the cross product of two vectors


def cross_product(vector1, vector2):
# Convert the input lists to NumPy arrays
vector1 = np.array(vector1)
vector2 = np.array(vector2)

# Calculate the cross product


cross_product_result = np.cross(vector1, vector2)

16 | P a g e
return cross_product_result

# Example usage
if __name__ == "__main__":
# Replace the following lists with the vectors you want to
compute the cross product for
vector_a = [1, 2, 3]
vector_b = [4, 5, 6]

# Call the function to compute the cross product


result = cross_product(vector_a, vector_b)

# Print the result


print("Cross product:", result)

Note: Please note that this is pseudo-code, and you'll need to copy it into a Python
environment (IDE or Jupyter Notebook) and import the NumPy library before running
the code. Additionally, make sure to replace the vector_a and vector_b lists with the
actual vectors for which you want to compute the cross product.

RESULTS:
Note: Include print copy of System generated actual output
----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

PRE LAB QUESTIONS:

17 | P a g e
Here are some pre-lab questions for the NumPy program that computes the cross
product of two given vectors:
1. What is NumPy, and what are its main features that make it popular in scientific
computing with Python?
2. Explain the concept of a cross product between two vectors in three-dimensional
space.
3. What is the significance of the cross product in physics and engineering
applications?
4. Describe the basic steps you would follow to compute the cross product of two
vectors manually.
5. What are the advantages of using NumPy arrays over regular Python lists when
performing mathematical operations?

SAMPLE VIVA VOCE QUESTIONS:


Here are some viva voce questions for the NumPy program that computes the cross
product of two given vectors:
1. How do you import the NumPy library in Python?
2. What is the function used to compute the cross product of two vectors in
NumPy?
3. In the NumPy cross product function, what is the order of the input arguments
for computing the cross product: (vector1, vector2) or (vector2, vector1)?
4. If you have two vectors, vector_a = [1, 2, 3] and vector_b = [4, 5, 6], what will be
the resulting cross product when you use the NumPy function?
5. Can you perform the cross product operation on vectors of different
dimensions using NumPy? Why or why not?
6. What happens if the input vectors to the NumPy cross product function are
parallel or anti-parallel to each other?
7. How does NumPy handle the data types of the elements in the input vectors
during the cross product computation?
8. Is the cross product a commutative operation? Explain why or why not.
9. Besides the cross product, are there any other methods to compute the product
of two vectors using NumPy?
10. How would you interpret the result of the cross product in terms of the
original vectors' direction and the right-hand rule?

18 | P a g e
GAP ANALYSIS BY THE COURSE FACULTY /
COORDINATOR

…………………………………………………………………..

…………………………………………………………………..

…………………………………………………………………..

…………………………………………………………………..

…………………………………………………………………..

…………………………………………………………………..

…………………………………………………………………..

…………………………………………………………………..

…………………………………………………………………..

…………………………………………………………………..

Faculty name & Signature with date

HoD/BoS Chairman remarks:

……………………………………………………………………………

……………………………………………………………………………

………………………………………………………………………….…

19 | P a g e
HoD/BoS chairman Signature with date

20 | P a g e

You might also like