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

Programs List

The document outlines the structure and requirements for the SSCE 2024 Computer Science exam, including general instructions for two main questions. Question I involves programming tasks in Python, requiring students to write scripts and functions with specific outputs, while Question II consists of answering queries related to SQL tables. The document also includes a sample text file content and various programming tasks related to file handling, data types, and database queries.

Uploaded by

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

Programs List

The document outlines the structure and requirements for the SSCE 2024 Computer Science exam, including general instructions for two main questions. Question I involves programming tasks in Python, requiring students to write scripts and functions with specific outputs, while Question II consists of answering queries related to SQL tables. The document also includes a sample text file content and various programming tasks related to file handling, data types, and database queries.

Uploaded by

Deepti Korde
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

SSCE 2024

Computer Science
Full Marks: 30 Duration: 3 hrs

General Instructions:
1. For Question I:
a. Attempt one sub-part allotted to you.
b. Write the question allotted to you, followed by the program, then the output.
c. Your program should have at least 5 comments.
2. For Question II:
a. Answer four queries allotted to you.
b. Write each question allotted to you, followed by the answer, then the output.

Lab Test
Python Report File Project Viva
SQL
Docu- Code commands
Logic
mentation Quality
4 2 2 4 7 8 3

For the questions on text file, assume the following content of "India.txt".

India became independent on 15th August, 1947.

I 1. Write a program to create a dictionary containing numbers from 1 to 7 as keys and the days of

7. The script should print the matching day of the week. If a number outside the range 1 to 7 is
input, the script should display an error. Show output of a valid input as well as an invalid input.

2. At a casino, to play, you have to pay Re. 1. Two dice are thrown. If the two dice show the same
number, you get Rs 10; else you lose your Re. 1. WAPS to simulate the throw of the dice, using
random integers. Show output of the player winning and another of the player losing.

3. Write a Python script to show mutability and immutability of Python data types.

4. Write a Python script to show the working of local and global variables.

Page 1 of 4
5. Write function (name="Mohan", age=49) to demonstrate the working of positional, keyword &
default arguments. Invoke the functions with the following values:

Function calls Expected output:


function("Alice", 83) Alice is 83 years old.
function(name= "Jack", age=23) Jack is 23 years old.
function(age=23, name= "Jack") Jack is 23 years old.
function() Mohan is 49 years old.
function("Sanju") Sanju is 49 years old.

6. Write noOfChars() that returns the number of characters in a text file "India.txt". For the given
text file, the output should be: 46 characters

7. Write typesOfCharacters() to read a text file "India.txt" & print the number of alphabets, digits &
special characters in it. For the given file, the output should be: 32 alphabets, 6 digits, 8 specials

8. Write a Python script to read a text file, "India.txt"


text file "Bharat.txt". Display the contents of "Bharat.txt".

Bharat.txt independent on 15th August, 1947

9. Write a Python script with the following functions:


Add() to create a binary file "Friends.bin" and append name and mark of a students to it.
Read() to read the binary file contents and print the details of those students who got above
75%. If nobody got above 75%, print the message "No student above 75%."

Invoke Add(), to append 3 records to the file.


Invoke Read(), to display the records of those with marks greater than 75.

10. Write a Python script with the following functions:


Add() to create a binary file "School.bin" which inputs the name and mark of a student, stores
the same into a list and writes the same to the binary file.
Modify() to add 2 to the marks of each student.
Display() to display the records of the students.

Invoke Add(), to append 3 records to the file. Invoke Display() to display the records.
Invoke Modify() to modify the file.
Invoke Display() to display the modified records.

Page 2 of 4
11. Write the following functions:
WriteCSV() to write the details of 3 inventors as shown below, to a CSV file "Inventors.csv".
1, "Linus Torvalds", "Linux Kernel"
2, "Tim Berners-Lee", "World Wide Web"
3, "Guido van Rossum", "Python"
ReadCSV() to read the file contents and print the same.
Invoke the functions.

12. Write the following functions:


AddUser() to append user_id and password to a CSV file, "Users.csv".
CheckUser() to input user_id & password. If user_id is found & matches the stored password,
. Otherwise, print

Invoke AddUser() 3 times.


Invoke CheckUser() to show output where password is accepted as well as where it is refused.

13. Write the following functions to work on a stack, maintained as a list:


Push() to input an integer & write it to the stack.
Pop() to pop all elements from the stack. When the stack is empty, display "Empty Stack".

Invoke Push() 3 times. Invoke Pop().


E.g., if 5, 9 and -2 are input, on invoking Pop, expected output would be: -2 9 5 Empty stack

14. Write a menu-based program with functions to add, delete and display records of hostel
residents using a list as a stack. A record of hostel should contain the following fields:
HostelName, Rooms, Residents. The format of the menu is shown:
a) Add Hostel
b) Delete Hostel
c) Display all Hostels
d) Exit

Push() should ask the user for Hostel details, convert it into a list and add it to the stack.
Pop() pops 1 element from stack and displays U

Page 3 of 4
II Answer the four queries allotted to you, with reference to tables accessories and shoppe.

Table: Accessories Table: Shoppe


+-----+-------------+-------+------+ +------+--------------------+-------------+
| no | name | price | id | | id | sname | area |
+-----+-------------+-------+------+ +------+--------------------+-------------+
| A01 | Motherboard | 12000 | S001 | | S001 | ABC Computronics | CP Nagar |
| A02 | Hard Disk | 5000 | S001 | | S002 | All Infotech Medic | GK II |
| A03 | Keyboard | 500 | S002 | | S003 | Tech Shoppe | CP Nagar |
| A04 | Mouse | NULL | S001 | | S004 | Geeks Techno Soft | Nehru Place |
| A05 | Motherboard | 13000 | S002 | | S005 | Geeks Hitech Store | Nehru Place |
| A06 | Keyboard | 400 | S003 | +------+--------------------+-------------+
| A07 | LCD | 6000 | S004 |
| A08 | LCD | 5500 | S005 |
| A09 | Mouse | 350 | S005 |
| A10 | Hard Disk | 4500 | S003 |
+-----+-------------+-------+------+

1. To display id and sname of shops from table shoppe located in 'GK II'.
2. To display shoppe names from table shoppe which contains the word 'Tech'.
3. To display each accessory name without repetition.
4. To display name, id & sname of accessories sold by Tech Shoppe.
5. To display details of accessories whose price is more than 10000.
6. To display shop names whose name begins with 'G'.
7. To display the Natural Join of the 2 tables for id S001.
8. To display details from both tables where price is not known.

Page 4 of 4

You might also like