Python assignment 1
Python assignment 1
Name:Augustine W
Bezalel
Register number:
2210154 Department:
BME
Section: S12
Question 2:
Design a test management system for your current 1st semester
with the following modules.
1. Year and section-wise student repository creation
2. Test Schedule database
3. Test attendance entry
4. Report generation
Module 2:
Step 1: Start
Step 2: Create a SQLite database called 'test_schedule.db'.
Step 3: Create a table called 'tests' which has six columns:
Year, Semester, Test type, Subject, Subject code and date of
test.
Step 4: Create a menu by prompting the user to choose between
options 1 to 5 where each corresponds to: 1. Viewing test
database,
2. Adding new test schedules, 3. Editing test schedules, 4.
Deleting test schedule, 5. Exiting menu.
Step 5: If menu option=1, connect to the database and assign
a variable data to fetch all the test schedules in the table
which is in the database. Print data. Return to step 4.
Step 6: If menu option=2, prompt the user for input of how
many test schedules they would like to add. Then for each test
schedule, get the input for year, semester, test type,
subject, subject code and test date as input from the user and
insert them into the respective columns of the table. Return
to step 4.
Step 7: If menu option=3, prompt the user for input of the
year, semester and subject code of the test for which the
date must be updated. Return to step 4.
Step 8: If menu option=4, prompt the user for input of the
year, semester, subject code and type of test to delete
that row in the table. Return to step 4.
Step 9: If menu option=5, Exit from the
menu. Step 10: Print the table with the test
schedules. Step 11: Stop.
Module 3:
Step 1: Start
Step 2: Create lists for CAT1, CAT2 and End Semester test
schedules. Then separate the test schedules in the table
'tests' into the respective lists.
Step 3: Prompt the user for the test type for which they are
adding the list of absentees.
Step 4: For test type=CAT1, create an empty dictionary.
Step 5: For the number of test schedules in CAT1 test type,
prompt the user for the date.
Step 6: Then prompt the user for the number of students who
were absent and then obtain the register numbers of all
absentees and add them to a list.
Step 7: Now add the date as key to the empty dictionary and
assign the list of absentees as the value for each
corresponding date key.
Step 8: Repeat steps 4-7 for test types CAT2 and End Semester.
Step 9: Print the three dictionaries which have the date and
the corresponding list of absentees on that date.
Step 10: Stop.