0% found this document useful (0 votes)
42 views

Class XII Program File 2

The document provides 7 questions for a Class XII computer science exam, including writing programs to play a word jumble game, create and search a customer dictionary, count characters in a text file using a user-defined function, delete a file, count lines starting with a letter in a text file, store and search film details in a pickled binary file, and create and search a CSV file with user IDs and passwords. Students are instructed to code the programs and save their work for a future board practical examination.

Uploaded by

Dance on floor
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Class XII Program File 2

The document provides 7 questions for a Class XII computer science exam, including writing programs to play a word jumble game, create and search a customer dictionary, count characters in a text file using a user-defined function, delete a file, count lines starting with a letter in a text file, store and search film details in a pickled binary file, and create and search a CSV file with user IDs and passwords. Students are instructed to code the programs and save their work for a future board practical examination.

Uploaded by

Dance on floor
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Class XII

Subject :- Computer Science

Note:- Do the following questions in your system and save it, as in future you

have to take printout of it for board practical examination.

1) Write a program for word jumble game where computer will randomly pick a word from a

sequence (tuple). The user would guess a word from the tuple, if it is correct, then print

an appropriate message. The tuple is given as follows:

a. WORDS=(“Python”,”Cobol”,”C++”,”java”,”Visual Studio”, “MySql”,”Fortran”)

2) Write a program to create a dictionary containing customer name with respective phone

numbers from user`s choice. Search the name of a customer and print the phone

number of that name. Also, display the details of the dictionary in two column format.

3) Write a program with a user-defined function to read the content from a text file

MAGIC.TXT which counts and displays the number of alphabets, digits, and

spaces present in it.

Example

If the file content is :

The magic of 5 y friends can be compared with 3 children

The young ones are in age 18 and the children are below 10.

Output:

Total lines : 2

Total alphabets : 88
Total digits are : 6

Total spaces are : 24

4) Write a program to delete the file (s) which you want should no longer exist in

your computer. The file name should be entered at the time of program

execution. If the entered file does not exist, display a proper message on screen.

5) Write a function count_A() to count and display the number of lines starting with

alphabet ‘A’ present in a text file file “LINES.TXT”.

Example : If the file “LINES.TXT” contains the following lines,

A boy is playing there.

There is a playground.

An aeroplane is in the sky.

Alphabets and numbers are allowed in the password.

The function should display: Total lines starting with alphabet ‘A’ is :3

6) Considering the following definition of dictionary Film,

FILM = { 'FNo' :<film numbers>, ’FName' : <film name>, 'FType’: <film type>}

Write a program in Python having functions to

(i) Create a pickled binary file CINEMA.DAT, which stores the details of FILMs.

Input the FILM details from user, as long as the user wants.

(ii) Search and display all the content in a pickled file CINEMA.DAT, where

FType is matching with the value 'Comedy'.

7) Create a CSV file by entering user-id and password, read and search the password for

given userid.

You might also like