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

Class 12 - Computer Science - Assignment

The document outlines an assignment for Class 12 Computer Science focusing on data structures and Python programming. It includes tasks such as creating functions to check list order, implementing stack operations for package management, and handling customer data for an insurance company using database connectivity. Additionally, it covers Python's database interface and methods for retrieving results from a database.

Uploaded by

S.S.Anitha
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)
3 views1 page

Class 12 - Computer Science - Assignment

The document outlines an assignment for Class 12 Computer Science focusing on data structures and Python programming. It includes tasks such as creating functions to check list order, implementing stack operations for package management, and handling customer data for an insurance company using database connectivity. Additionally, it covers Python's database interface and methods for retrieving results from a database.

Uploaded by

S.S.Anitha
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

CLASS 12 - COMPUTER SCIENCE - ASSIGNMENT

DATA STRUCTURE

1) Write a program to input 2 lists and define a function to check if both the lists are
sorted in ascending order, descending order, no order. The function has to return
1 if it is in ascending, 0 if it is in descending, otherwise -1.
2) Define the functions MakePush(Package) and MakePop(Package) to add a new
package and delete a package from a list of package description, considering
them to act as push and pop operations of stack data structure.
3) Define function PushCopies(String) that adds those words which occur more
than once in the String into a stack which is implemented as a [Link] define
Pop() to remove the topmost element and Peep() to display the topmost element
from the stack.

PYTHON INTERFACE
1) What is python’s database interface known as?
2) Explain the following ‘results’ retrieval methods- fetchone(), fetchall(), rowcount
3) ABC company is an insurance company that stores the details of its customers in
customer table with the fields - Policyno-int,Name-15 characters,policyname-15
characters,phno-int,Assured_amt - float , Premium- float,period-int(in years) .
Consider the following for database connectivity:
database-ABC , password-policy
Define following functions:
Insert() - That inputs all the above details and inserts a row in customer table.
Print() - That prints those records whose period is more than 5 years and
Assured amount is more than 500000.

You might also like