0% found this document useful (0 votes)
2 views54 pages

Program File Finale

The document outlines a Computer Science program for the academic year 2025-2026, detailing various programming tasks and projects for Class XII students. It includes assignments on Python programming, file handling, data structures, MySQL queries, and integrating MySQL with Python. Each section contains specific programming tasks, source code examples, and expected outputs.

Uploaded by

Siddhant Mishra
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)
2 views54 pages

Program File Finale

The document outlines a Computer Science program for the academic year 2025-2026, detailing various programming tasks and projects for Class XII students. It includes assignments on Python programming, file handling, data structures, MySQL queries, and integrating MySQL with Python. Each section contains specific programming tasks, source code examples, and expected outputs.

Uploaded by

Siddhant Mishra
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

MAYUR PUBLIC

SCHOOL
Computer Science(083)
Program File
2025-2026
Submitted by : Siddhant Mishra
Class : XII-‘D’
Roll no:
INDEX
[Link] CHAPTER PROGRAM DATE
NAME
1. Python a. Program to calculate & print
roots of a quadratic equation
revision tour ax^^2+bx+bx+c=0.
I & II
b. Program to print the
following pattern.

c. Write a program that ask the


user the day number in a year
in the range 2 to 365 & ask the
first day of the year, Sunday or
Monday or Tuesday, etc. Then
the program should display the
day on the day number that has
been input.

d. Write a program that


prompts for a phone number of
10 digits & 2 dashes with
dashes after the area code &
the next three numbers. For
example, 017-555-1212 is a
legal input.

2. Working a. Write a program to create a


CSV file [Link]
with containing Employee ID,
Functions Name, & Salary.

b. Write a function that takes a


number & returns True if the
number is a palindrome & sum
of its digits is even.

c. Write a function that takes a


number & returns True if the
number has all unique digits,
otherwise False.

d. Write a function that


generates a series using a
function which takes first &
last values of the series & then
generates four terms that are
equidistant.
3. File a. Write a function that reads a
file & returns the number of
Handling lines where words are in
alphabetical order.

b. Write a function that reads a


file & counts the number of
words having exactly two
vowels.

c. Write a function that reads a


file & returns True if the file
contains any line with all
words of equal length,
otherwise False.

d. Write a function that reads a


file & returns the count of
words ending with the same
character they start with.
4. Data a. 1. Write a function that splits
a stack into two stacks:
Structure
 one containing even
numbers
 the other containing odd
numbers

b. Write a function that counts


the number of prime numbers
present in a stack without
disturbing its original contents.

c. Write a function that


replaces every prime number
in the stack with its square,
keeping the stack order
unchanged.

d. Write a function that checks


whether a stack follows the
pattern:
increasing till middle &
decreasing after that.

5. My SQL a. Query to create a table


student & insert values in it.
Queries
b. Query to Display the Roll
No of students whose marks
are not equal to the minimum
marks obtained in the table.

c. Query to Increase the marks


by 5 for students scoring less
than 40.

d. The school wants to identify


toppers.
Write a query to display names
of students who scored the
highest marks, even if more
than one topper exists.

6. My SQL a. A program to integrate


MySQL with python (creating
connectivity database & table)
programs b. A program to integrate
MySQL with python(inserting
records and displaying records)
c. A program to integrate
MySQL with python(searching
and displaying records)
d. A program to integrate
MySQL with python(Updating
records)
PART-1:
PYTHON
REVISION TOUR 1
&
PYTHON REVISION
TOUR 2

1. Program to calculate & print roots of a quadratic


equation [ax^^2+bx+bx+c=0]
SOURCE CODE
Output

2. Program to print the following pattern:


1
212
32123
4321234
543212345

SOURCE CODE
Output
3. Write a program that ask the user the day number in a
year in the range 2 to 365 & ask the first day of the year,
Sunday or Monday or Tuesday, etc. Then the program
should display the day on the day number that has been
input.

SOURCE CODE
Output
4. Write a program that prompts for a phone number of
10 digits & 2 dashes with dashes after the area code & the
next three numbers. For example, 017-555-1212 is a legal
input.

SOURCE CODE

3.
Output
PART 2:
WORKING
WITH
FUNCTIONS
1. Write a program to create a CSV file
[Link] containing Employee ID, Name, &
Salary.

SOURCE CODE
Output

[Link] a function that takes a number & returns


True if the number is a palindrome & sum of its
digits is even.
SOURCE CODE

Output
3. Write a function that takes a number & returns
True if the number has all unique digits, otherwise
False.
SOURCE CODE
Output
4. Write a function that generates a series using a
function which takes first & last values of the series
& then generates four terms that are equidistant.
Example, if two numbers pass that 1 & 7 then
function returns 1 3 5 7.
SOURCE CODE
Output
PART 3: FILE
HANDLING

1. Write a function that reads a file & returns the


number of lines where words are in alphabetical
order.
SOURCE CODE

Output
2. Write a function that reads a file & counts the
number of words having exactly two vowels.
SOURCE CODE

Output
.
3 Write a function that reads a file & returns True
if the file contains any line with all words of equal
length, otherwise False.
SOURCE CODE

Output
4. Write a function that reads a file & returns the
count of words ending with the same character they
start with.
SOURCE CODE

Output
PART-4:
DATA
STRUCTURE
1. Write a function that splits a stack into two
stacks:
 one containing even numbers
 the other containing odd numbers
SOURCE CODE

Output
2. Write a function that counts the number of prime
numbers present in a stack without disturbing its
original contents.

SOURCE CODE
Output
3. Write a function that replaces every prime
number in the stack with its square, keeping the
stack order unchanged.
SOURCE CODE
Output

4. Write a function that checks whether a stack


follows the pattern:
increasing till middle & decreasing after that
SOURCE CODE

Output
PART-5:
MY SQL
QUERIES
1. Query to create a table student & insert values in
it.

QUERY & OUTPUT

2. Query to Display the Roll No of students whose


marks are not equal to the minimum marks obtained
in the table.
QUERY & OUTPUT

3. Query to Increase the marks by 5 for students


scoring less than 40.
QUERY & OUTPUT

4. The school wants to identify toppers.


Write a query to display names of students who
scored the highest marks, even if more than one

topper exists.

QUERY & OUTPUT

PART-6:
PYTHON SQL
CONNECTIVITY
PROGRAMS

1. Creating a python program to integrate MYSQL


with Python (Creating database and table)

SOURCE CODE
Output
2. Creating a python program to integrate MYSQL
with python (Inserting records and displaying
records)
SOURCE CODE
Output
3. A program to integrate MySQL with python
(searching and displaying records)
SOURCE CODE
Output
4. A program to integrate MySQL with
python(Updating records)
SOURCE CODE
Output

You might also like