Word 1674051505685
Word 1674051505685
Word 1674051505685
SAIL TOWNSHIP,RANCHI
REPORT FILE
CLASS-XII: COMPUTER SCIENCE (083)
CLASS: XII H
ROLL NUMBER: 04
1
ACKNOWLEDGEMENT
I would like to express my special thanks of
gratitude to my Computer Teacher "Mr. Gautam
Chakraborty" for his able guidance and support in
completing this project.
2
1. Write a program to enter two numbers and print the
arithmetic operations like +,-,*,/,// and % as per user
choice.
Ans:-
4
2. Write a program to check entered number is Armstrong
or not.
5
3. Write a program to enter the number of terms and to
print the Fibonacci series.
6
4. Write a program to enter the string and display the
longest word present in the entered string.
7
5. Write a python function that takes a number as a
parameter and checks whether a number is prime or
not.
8
6. Write a python function to add the first ‘n’ terms of the
series:
1+1/2-1/3+1/4-1/5+………………………
9
7. Write a program that accepts a hyphen-separated
sequence of words as input and print the words in a
hyphen-separated sequence after storing them
alphabetically.
Sample Items: green-red-yellow-black-white
Expected Result: black-green-red-white-yellow
Output:-
10
8. Write a python function to calculate the factorial of a
number (a non-negative integer). The function accepts
the number whose factorial is to be calculated as the
argument.
11
9. Write a program to remove all the lines that contain the
character “b” in a file and write it into another text file.
Output:-
12
10. Write a program to read a text file and display the
number of vowels/consonants/uppercase/lowercase
characters in the file.
13
11. Write a program to create a binary file with name
and roll no. Search for a given roll number and display
the name, if not found display appropriate message.
14
12. Write a program to create a binary file to store
Rollno, Name and Marks and update marks of entered
Rollno.
15
13. Write a program to implement a stack using a list
data structure.
16
14. Write a program to read a text file line by line and
display each word separated by #.
Output:-
17
15. Write a program to accept string/sentences from
the user till the user enters “END”. Save the data in a
text file and then display only those sentences which
begin with an uppercase alphabet.
Output:-
18
16. Write a program to read a file ‘Story.txt’ and create
another file, storing an index of ‘Story.txt’, telling which
line of the file each words appears in. If word appears
more than once, then index should show all the line
numbers containing the word.
Output:-
19
17. Write a program to display the size of the file after
removing EOL characters, leading and trailing white
spaces and blank lines.
Output:-
20
18. Raj has been asked to display all the students who
have secured less than 40 for Remedial Classes. Write a
user-defined function to display those students who
have secured less than 40 from the binary file
“Student.dat”.
21
19. Write a program to create CSV file and store
empno, name, salary and search any empno and display
name, salary and if not found appropriate message.
Output:-
22
20. Write a menu driven program to implement Stack
in Python using List.
23
21. Write a program to connect with database and
store record of employee and display records.
Output:-
24
22. Write a program to connect with database and
search employee number in table employee and display
record, if empno not found display appropriate
message.
Output:-
25
23. Write a program to connect with database and
update the employee record of entered empno.
Output:-
26
24. Write a program to connect with database and
delete the record of entered employee number.
Output:-
27
25. Create a student table and insert data. Implement
the following SQL commands on the student table:
(a) ALTER table to add new attributes / modify data
type / drop attribute
(b) UPDATE table to modify data
(c) ORDER By to display data in ascending / descending
order
(d) DELETE to remove tuple(s)
(e) GROUP BY and find the min, max, sum, count and
average.
28
To modify data type:
To drop column:
29
(b) To modify data:
30
(d) To delete tuple
31
26. Create a table STUDENT and write sql commands for (a) to (f)
and write the outputs for (e) and (g) on the basis of the table
STUDENT:
TABLE: STUDENT
SNO NAME STREAM FEES AGE SEX
32
(a) SELECT NAME FROM STUDENT WHERE STREAM=’COMPUTER’;
33
(c) SELECT STREAM,COUNT(STREAM) FROM STUDENT GROUP BY STREAM;
34
(e) ALTER TABLE STUDENT ADD STIPEND INT;
UPDATE STUDENT SET STIPPEND=0.2*FEES;
35
27. Consider the following table named “Softdrink”. Write
commands of SQL for (i) to (iv).
TABLE:SOFTDRINK
DRINKCODE DNAME PRICE CALORIES
101 Lime and Lemon 20.00 120
102 Apple Drink 18.00 120
103 Nature Nectar 15.00 115
104 Green Mango 15.00 140
105 Aam Panna 20.00 135
106 Mango Juice Bahaar 12.00 150
36
(ii) SELECT DRINKCODE,DNAME,CALORIES FROM SOFTDRINK ORDER BY
CALORIES DESC;
37
28. Write a output for SQL queries (i) to (iii), which are
based on the table : student given below:
Table: Student
ROLLNO NAME CLASS DOB GENDER CITY MARKS
1 Nanda X 06-06-1995 M Agra 551
2 Saurabh XII 07-05-1993 M Mumbai 462
3 Sonal XI 06-05-199 F Delhi 400
4
4 Trisla XII 08-08-1995 F Mumbai 450
5 Aman XII 08-10-1995 M Delhi 369
6 Puja XI 12-12-1994 F Dubai 250
7 Neha X 08-12-1995 F Ranchi 377
8 Raj X 12-06-1995 M Ranchi 489
Write a SQL queries for (i) to (iv), which are based on the
table: student.
38
(i) Select count(*), city from student group by city having
count(*)>1;
Write a SQL queries for (i) to (iv), which are based on the table:
student.
39
(ii) To display Class, DOB and City whose marks is between
450 and 551.
SELECT CLASS,DOB,CITY FROM STUDENT WHERE MARKS BETWEEN 450 AND 551;
40
29. Consider the table CLUB given below.
Table: CLUB
COACH_ID COACH_NAME AGE SPORTS DATEOFAPP PAY SEX
Write the output of the queries (a) to (d) based on the table,
CLUB given above:
41
(i) SELECT COUNT (DISTINCT SPORTS) FROM CLUB;
42
30. Write SQL commands for the following queries (i) to
(iv) based on the relations Product and Client given below:
Table: Product
Talcum
TP01 LAK 40
Powder
Table: Client
43
i) Write SQL query to display ProductName and Price for all
products whose Price is in the range of 50 to 150.
ii) Write SQL query to display details of product whose
manufacturer is either XYZ or ABC
iii) Write SQL query to display ProductName, Manufacturer
and Price for all Products that are not given any discount.
iv) Write SQL query to display ClientName, City, and P_ID
for all clients whose city is Delhi.
(i) SELECT PRODUCTNAME,PRICE FROM PRODUCT WHERE PRICE BETWEEN
50 AND 150;
44
(iii) SELECT PRODUCT_NAME,MANUFACTURER,PRICE FROM PRODUCT
WHERE DISCOUNT IS NULL;
45