0% found this document useful (0 votes)
7 views1 page

Set A

The document outlines tasks for a Computer Science examination, including writing Python functions to count words ending with a digit and to display lines with at least 10 words from text files. It also includes a program to manage book records in a CSV file and perform searches based on publisher names. Additionally, it presents SQL query tasks related to computer and sales data tables, requiring outputs for minimum and maximum prices, company counts, product details for a specific quarter, and quantities of printers sold.

Uploaded by

bhowmiks503
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)
7 views1 page

Set A

The document outlines tasks for a Computer Science examination, including writing Python functions to count words ending with a digit and to display lines with at least 10 words from text files. It also includes a program to manage book records in a CSV file and perform searches based on publisher names. Additionally, it presents SQL query tasks related to computer and sales data tables, requiring outputs for minimum and maximum prices, company counts, product details for a specific quarter, and quantities of printers sold.

Uploaded by

bhowmiks503
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/ 1

ALL India Senior Secondary Certificate Examination

School Code:

Subject: Computer Science Subject Code: 083


Time: 3hr MM: 30
1) Write a function count_Dwords() in Python to count the words ending with a digit in a text file ‘Details.txt’.
Example:
If the file content is as follows:
On seat2 VIP1 will sit and
On seat1 VVIP2 will be sitting
Output will be:
Number of words ending with a digit are 4
OR
Write the definition of a Python function named LongLines( ) which read the contents of a text file named
‘Lines.txt’ and display those lines from the file which have at least 10 words in it.
Examples:
If the content of ‘Lines.txt’ is as follows:
Once upon a time, there was a woodcutter
He lived in a little house in a beautiful, green wood.
One day, he was merrily chopping some wood.
He saw a little girl skipping through the woods, whistling happily.
The girl was followed by a big gray wolf.

Then the function should display output as:


He lived in a little house in a beautiful, green wood.
He saw a little girl skipping through the woods, whistling happily.

2) Write a program in Python that defines and calls the following user defined functions:
(i) Add_Book( ): Take the details of the books and adds them t a csv file ‘Book.csv’. Each record consists of a
list with field elements as book_ID, B_name and pub to store book ID, book name and publisher respectively.

(ii) Search_Book( ): Takes publisher name as input and display the records of all books published by them.

B. Write the outputs of the SQL queries (i) to (iv) based on the relations COMPUTER and SALES given below:
Table: COMPUTER Table: SALES

PROD_ID PROD_NAME PRICE COMPANY TYPE PROD_ID QTY_SOLD QUARTER


P002 4 1
P001 MOUSE 200 LOGITECH INPUT
P003 2 2
P002 LASER PRINTER 4000 CANON OUTPUT
P001 3 2
P003 KEYBOARD 500 LOGITECH INPUT P004 2 1
P004 JOYSTICK 1000 IBALL INPUT

P005 SPEAKER 1200 CREATIVE OUTPUT

P006 DESKJET PRINTER 4300 CANON OUTPUT

(I) Display the minimum and maximum price from the table COMPUTER
(II) Display the count of each company
(III) Display the product name, type and quantity sold for 2nd quarter
(IV) Display the quantity of all printer sold

You might also like