CBSE Class 12 Computer Science

Download CBSE Class 12 Computer Science Question Papers with solutions and latest Sample Papers, notes, practicals and other study material for all important topics like arrays, boolean algebra, c++ revision tour, classes and objects, communication and network concepts, constructors and destructors, data file handling, database concepts, etc, access free study material in pdf, practice to get better marks in examinations. all study material has been prepared based on latest guidelines, term examination pattern and blueprint issued by cbse and ncert

Computer Science is the foundation of the digital age. Our study resources provided above include a detailed breakdown of the 30-mark Practical Exam, ensuring your Project Work and Report File meet board standards. Nowadays, everybody is talking about AI and Big Data. After performing well in Class 12, take first step toward B.Tech, BCA, or Data Science careers. We have also provided expert tips for your Viva Voce, helping you explain your code's logic clearly to external examiners that will visit your school. Stay consistent with your daily coding practice, master the SQL joins, and download and read our revision modules to transform your passion for technology into a top-tier academic result.

Learning Outcomes

  1. Understand the concept of functions and recursion.
  2. Learn how to create and use Python libraries.
  3. Learn file handling.
  4. Learn about the concept of efficiency in algorithms and computing in general.
  5. Learn basic data structures: lists, stacks, and queues.
  6. Get a basic understanding of computer networks: network stack, basic network hardware, basic protocols, and basic tools.
  7. Connect a Python program with an SQL database, and learn aggregation functions in SQL.
  8. Have  a  clear  understanding  of  cyber  ethics  and  cybercrime.  Understand  the  value  of technology in societies, gender and disability issues, and the technology behind biometric ids.

 

Distribution of Marks

Unit No.

Unit Name

Marks

1.

Programming and Computational Thinking – 2

30

2.

Computer Networks

15

3.

Data Management – 2

15

4.

Society, Law and Ethics – 2

10

5.

Practicals

30

 

Total

100

 

Unit 1: Programming and Computational Thinking (PCT-2)     (80 Theory + 70 Practical)

  1. Revision of the basics of Python
  2. Functions: scope, parameter passing, mutable/immutable properties of data objects, pass arrays to functions, return values, functions using libraries: mathematical, and string functions.
  3. File handling: open and close a file, read, write, and append to a file, standard input, output, and error streams, relative and absolute paths.
  4. Using Python libraries: create and import Python libraries
  5. Recursion:  simple  algorithms  with  recursion:  factorial,  Fibonacci  numbers;  recursion  on arrays: binary search
  6. Idea of efficiency: performance defined as inversely proportional to the wall clock time, count the number of operations a piece of code is performing, and measure the time taken by a program. Example: take two different programs for the same problem, and understand how the efficient one takes less time.
  7. Data visualization using Pyplot: line chart, pie chart, and bar chart.
  8. Data-structures: lists, stacks, queues.

 

Unit 2: Computer Networks (CN)              (30 Theory + 10 Practical)

  1. Structure of a network: Types of networks: local area and wide area (web and internet), new technologies such as cloud and IoT, public vs. private cloud, wired and wireless networks; concept of a client and server.
  2. Network devices such as a NIC, switch, hub, router, and access point.
  3. Network stack: amplitude and frequency modulation, collision in wireless networks, error checking, and the notion of a MAC address, main idea of routing. IP addresses: (v4 and v6), routing table, router, DNS, and web URLs, TCP: basic idea of retransmission, and rate modulation when there is congestion (analogy to a road network), Protocols: 2G, 3G, 4G, Wi- Fi. What makes a protocol have a higher bandwidth?
  4. Basic network tools: traceroute, ping, ipconfig, nslookup, whois, speed-test.
  5. Application layer: HTTP (basic idea), working of email, secure communication: encryption and certificates (HTTPS), network applications: remote desktop, remote login, HTTP, FTP, SCP, SSH, POP/IMAP, SMTP, VoIP, NFC.

 

Unit 3: Data Management (DM-2)            (20 Theory + 20 Practical)

  1. Write a minimal Django based web application that parses a GET and POST request, and writes the fields to a file - flat file and CSV file.
  2. Interface Python with an SQL database
  3. SQL commands: aggregation functions – having, group by, order by.

 

Unit 4: Society, Law and Ethics (SLE-2)    (10 Theory)

  1. Intellectual property rights, plagiarism, digital rights management, and licensing (Creative Commons, GPL and Apache), open source, open data, privacy.
  2. Privacy laws, fraud; cyber-crime- phishing, illegal downloads, child pornography, scams; cyber forensics, IT Act, 2000.
  3. Technology and society: understanding of societal issues and cultural changes induced by technology.
  4. E-waste management: proper disposal of used electronic gadgets.
  5. Identity theft, unique ids, and biometrics.
  6. Gender and disability issues while teaching and using computers.

 Also refer to NCERT Solutions for all classes by clicking here - NCERT Solutions

Practical

S.No.

 

Unit Name

Marks (Total=30)

1.

 

 

Lab Test (10 marks)

 

 

Python program (60% logic + 20% documentation + 20% code quality)

7

 

 

Small Python program that sends a SQL query to a database and displays the result. A stub program can be provided.

3

 

2.

 

Report File + viva(9 marks)

 

 

Report file: Minimum 21 Python programs. Out of this at least 4 programs should send SQL commands to a database and retrieve the result; at least 1 program should implement the web server to write user data to a CSV file.

7

 

 

Viva voce based on the report file

 

2

 

3.

 

Project + viva (11 marks)

 

 

Project (that uses most of the concepts that have been learnt)

8

 

 

Project viva voce

 

 

3

 

 

Some sample lab assignments are as follows:

Programming in Python:

  1. Recursively find the factorial of a natural number.
  2. Read a file line by line and print it.
  3. Remove all the lines that contain the character `a' in a file and write it to another file.
  4. Write a Python function sin(x, n) to calculate the value of sin(x) using its Taylor series expansion up to n terms. Compare the values of sin(x) for different values of n with the correct value.
  5. Write  a  random  number  generator  that  generates  random  numbers  between  1  and  6 (simulates a dice).
  6. Write a recursive code to find the sum of all elements of a list.
  7. Write a recursive code to compute the nth Fibonacci number.
  8. Write a Python program to implement a stack and queue using a list data-structure.
  9. Write a recursive Python program to test if a string is a palindrome or not.
  10. Write a Python program to plot the function y = x2 using the pyplot or matplotlib libraries.
  11. Create a graphical application that accepts user inputs, performs some operation on them, and then writes the output on the screen. For example, write a small calculator. Use the tkinter library.
  12. Open a webpage using the urllib library.
  13. Compute EMIs for a loan using the numpy or scipy libraries.
  14. Take a sample of 10 phishing e-mails and find the most common words.

 

Data Management: SQL and web-server

  1. Find the min, max, sum, and average of the marks in a student marks table.
  2. Find the total number of customers from each country in the table (customer ID, customer name, country) using group by.
  3. Write a SQL query to order the (student ID, marks) table in descending order of the marks.
  4. Integrate SQL with Python by importing the MySQL module
  5. Write a Django based web server to parse a user request (POST), and write it to a CSV file.

 

Project

The aim of the class project is to create something that is tangible and useful. This should be done in groups of 2 to 3 students, and should be started by students at least 6 months before the submission deadline. The aim here is to find a real world problem that is worthwhile to solve. Students are encouraged to visit local businesses and ask them about the problems that they are facing. For example, if a business is finding it hard to create invoices for filing GST claims, then students can do a project that takes the raw data (list of transactions), groups the transactions by category, accounts for the GST tax rates, and creates invoices in the appropriate format. Students can be extremely creative here. They can use a wide variety of Python libraries to create user friendly applications such as games, software for their school, software for their disabled fellow students, and mobile applications, Of course to do some of this projects, some additional learning is required; this should be encouraged. Students should know how to teach themselves.

If three people work on a project for 6 months, at least 500 lines of code is expected. The committee has also been made aware about the degree of plagiarism in such projects. Teachers should take a very strict look at this situation, and take very strict disciplinary action against students who are cheating on lab assignments, or projects, or using pirated software to do the same. Everything that is proposed can be achieved using absolutely free, and legitimate open source software.

Unit 1: Computational Thinking and Programming – 2 (40 Marks)

  • Revision of Python topics covered in Class XI.
  • Functions: types of function (built-in functions, functions defined in module, user defined functions), creating user defined function, arguments and parameters, default parameters, positional parameters, function returning value(s), flow of execution, scope of a variable (global scope, local scope)
  • Exception Handling: Introduction, handling exceptions using try-except-finally blocks
  • Introduction to files, types of files (Text file, Binary file, CSV file), relative and absolute paths
  • Text file: opening a text file, text file open modes (r, r+, w, w+, a, a+), closing a text file, opening a file using with clause, writing/appending data to a text file using write() and writelines(), reading from a text file using read(), readline() and readlines(), seek and tell methods, manipulation of data in a text file
  • Binary file: basic operations on a binary file: open using file open modes (rb, rb+, wb, wb+, ab, ab+), close a binary file, import pickle module, dump() and load() method, read, write/create, search, append and update operations in a binary file
  • CSV file: import csv module, open / close csv file, write into a csv file using writer(),writerow(),writerows() and read from a csv file using reader()
  • Data Structure: Stack, operations on stack (push & pop), implementation of stack using list.

Note for Students: This unit builds upon Class XI knowledge to master advanced Python concepts, including file handling and data structures like Stacks.


Unit 2: Computer Networks (10 Marks)

  • Evolution of networking: introduction to computer networks, evolution of networking (ARPANET, NSFNET, INTERNET)
  • Data communication terminologies: concept of communication, components of data communication (sender,receiver, message, communication media, protocols), measuring capacity of communication media (bandwidth, data transfer rate), IP address, switching techniques (Circuit switching, Packet switching)
  • Transmission media: Wired communication media (Twisted pair cable, Co-axial cable, Fiber-optic cable), Wireless media (Radio waves, Micro waves, Infrared waves)
  • Network devices (Modem, Ethernet card, RJ45, Repeater, Hub, Switch, Router, Gateway, WIFI card)
  • Network topologies and Network types: types of networks (PAN, LAN, MAN, WAN), networking topologies (Bus, Star, Tree)
  • Network protocol: HTTP, FTP, PPP, SMTP, TCP/IP, POP3, HTTPS, TELNET, VoIP
  • Introduction to web services: WWW, Hyper Text Markup Language (HTML), Extensible Markup Language (XML), domain names, URL, website, web browser, web servers, web hosting

Note for Students: You will learn the fundamental infrastructure of the internet, covering everything from physical cables and hardware to the protocols that govern web communication.


Unit 3: Database Management (20 Marks)

  • Database concepts: introduction to database concepts and its need
  • Relational data model: relation, attribute, tuple, domain, degree, cardinality, keys (candidate key, primary key, alternate key, foreign key)
  • Structured Query Language: introduction, Data Definition Language and Data Manipulation Language, data type (char(n), varchar(n), int, float, date), constraints (not null, unique, primary key), create database, use database, show databases, drop database, show tables, create table, describe table, alter table (add and remove an attribute, add and remove primary key), drop table, insert, delete, select, operators (mathematical, relational and logical), aliasing, distinct clause, where clause, in, between, order by, meaning of null, is null, is not null, like, update command, delete command, aggregate functions (max, min, avg, sum, count), group by, having clause, joins: cartesian product on two tables, equi-join and natural join
  • Interface of python with an SQL database: connecting SQL with Python, performing insert, update, delete queries using cursor, display data by using connect(), cursor(), execute(), commit(), fetchone(), fetchall(), rowcount, creating database connectivity applications, use of %s format specifier or format() to perform queries

Note for Students: This unit focuses on how to organize large datasets using SQL and how to create bridge applications that connect Python programs to databases.


5. Practical (30 Marks)

  • Lab Test: Python program (60% logic + 20% documentation + 20% code quality) [8 Marks] and SQL queries (4 queries based on one or two tables) [4 Marks].
  • Report file: Minimum 15 Python programs, SQL Queries – Minimum 5 sets using one table / two tables, and Minimum 4 programs based on Python — SQL connectivity [7 Marks].
  • Project: using concepts learnt in Classes 11 and 12 [8 Marks].
  • Viva voce: [3 Marks].

Note for Students: The practical component evaluates your hands-on coding abilities, database management skills, and your capacity to apply integrated concepts to a major project.


6. Suggested Practical List: Python Programming

  • Read a text file line by line and display each word separated by a #.
  • Read a text file and display the number of vowels/consonants/uppercase/lowercase characters in the file.
  • Remove all the lines that contain the character 'a' in a file and write it to another file.
  • Create a binary file with name and roll number. Search for a given roll number and display the name, if not found display appropriate message.
  • Create a binary file with roll number, name and marks. Input a roll number and update the marks.
  • Write a random number generator that generates random numbers between 1 and 6 (simulates a dice).
  • Write a Python program to implement a stack using list.
  • Create a CSV file by entering user-id and password, read and search the password for given userid.

Note for Students: These programming tasks focus on file manipulation and data structure implementation, providing essential practice for the final lab assessment.


7. Suggested Practical List: Database Management

  • Create a student table and insert data. Implement the following SQL commands on the student table: ALTER table to add new attributes / modify data type / drop attribute; UPDATE table to modify data; ORDER By to display data in ascending / descending order; DELETE to remove tuple(s); GROUP BY and find the min, max, sum, count and average.
  • Integrate SQL with Python by importing suitable module.

Note for Students: Mastering these SQL commands and their integration with Python is vital for building robust, data-driven applications.


8. Project Guidelines

  • Aim: create something that is tangible and useful using Python file handling/ Python-SQL connectivity.
  • Teamwork: groups of two to three students, started at least 6 months before the submission deadline.
  • Problem Solving: find a real world problem that is worthwhile to solve, such as creating invoices,

The marks are strictly allocated as follows:

Computational Thinking and Programming – 2 (40 Marks): The core of the syllabus. Focus on File Handling (Text, Binary, CSV), Functions (Scope and Parameters), and Data Structures (Stack implementation using Lists).

Database Management (20 Marks): High-scoring unit. Mastery of SQL Commands (DDL/DML), Aggregate functions, and Python-SQL Connectivity is essential.

Computer Networks (10 Marks): Theoretical but vital. Understand Network Topologies, Protocols (TCP/IP, HTTP, FTP), and Network Devices (Hub, Switch, Router).