0% found this document useful (0 votes)
3 views22 pages

PSUP Sample Questions

Uploaded by

2503a520p9
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)
3 views22 pages

PSUP Sample Questions

Uploaded by

2503a520p9
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

PSUP: Sample Questions

1. SMART LIBRARY MANAGEMENT SYSTEM


A college library maintains records of books and student transactions manually, which often leads to errors.
To improve efficiency, the librarian wants a Python-based system.

The library currently has the following books:

• Book ID 101 → Python Basics → Copies: 2

• Book ID 102 → Data Structures → Copies: 1

The following sequence of operations occurs:

1. Student A borrows Book ID 101

2. Student B borrows Book ID 101

3. Student C tries to borrow Book ID 101

4. Student A returns Book ID 101

The system must track book availability, prevent invalid borrowing, and maintain transaction history.

Tasks:

• Represent books and students using Object-Oriented Programming (Classes & Objects)

• Store book data using Dictionaries and Lists

• Process operations using Conditional Statements and Loops

• Maintain transaction history using File Handling

• Use Functions to organize borrowing and returning logic

• Handle invalid operations using Exception Handling

• Display updated records using String Formatting (f-strings)

Probable Output:

• Book 101 issued to Student A → Copies left: 1

• Book 101 issued to Student B → Copies left: 0

• Student C request denied → No copies available


• Book returned by Student A → Copies available: 1

• Final inventory and transaction log displayed

2. ONLINE FOOD ORDERING SYSTEM


A food delivery startup wants to automate its ordering process. The system should allow customers to
select items, modify orders, and calculate the total bill with discounts.

Menu:

• Burger → ₹120

• Pizza → ₹250

• Coke → ₹50

Customer actions:

• Adds 2 Burgers

• Adds 1 Pizza

• Removes 1 Burger

• Applies 10% discount

The system must update the cart dynamically and generate a final bill.

Tasks:

• Represent menu and cart using Dictionaries and Lists

• Implement order logic using Functions

• Process item updates using Loops and Conditional Statements

• Apply discount using Arithmetic Operations

• Handle invalid inputs using Exception Handling

• Display bill using String Formatting (f-strings)

• Store order history using File Handling

Probable Output:

• Items: 1 Burger + 1 Pizza

• Total before discount: ₹370


• Discount applied: ₹37

• Final amount: ₹333

• Display formatted bill

3. STUDENT PERFORMANCE ANALYZER


A school wants to automate the analysis of student performance. The system should compute grades,
identify toppers, and generate reports.

Student data:

Name Marks

Ravi 85

Anu 92

John 67

Meena 45

The system must calculate averages, assign grades, and identify students who failed.

Tasks:

• Store student data using Lists and Dictionaries

• Process data using Loops and Conditional Statements

• Calculate results using Functions

• Assign grades using Nested Conditions

• Handle missing/invalid data using Exception Handling

• Save results using File Handling

• Display report using String Formatting

Probable Output:

• Average marks: 72.25

• Grades: Ravi (B), Anu (A), John (C), Meena (Fail)

• Topper: Anu
• Failed student: Meena

• Display formatted report

4. ATM BANKING SIMULATOR


A bank wants to simulate ATM operations digitally. Each user has an account balance, and transactions
must be processed securely.

Initial balance: ₹5000

Transactions performed:

1. Withdraw ₹2000

2. Deposit ₹1500

3. Withdraw ₹6000

The system must prevent overdrawing and keep a record of transactions.

Tasks:

• Represent account using Class (OOP)

• Perform transactions using Functions

• Validate operations using Conditional Statements

• Process multiple transactions using Loops

• Maintain transaction history using Lists

• Save data using File Handling

• Handle errors using Exception Handling

Probable Output:

• Withdrawal successful → Balance: ₹3000

• Deposit successful → Balance: ₹4500

• Withdrawal denied → Insufficient balance

• Final balance: ₹4500

• Transaction history displayed


5. MOVIE TICKET BOOKING SYSTEM
A cinema hall wants to automate seat booking. Seats are limited, and the system must prevent double
booking.

Available seats: [1, 2, 3, 4, 5]

Booking actions:

• User 1 books seat 2

• User 2 books seat 3

• User 3 tries to book seat 2

• User 1 cancels seat 2

The system should update seat availability dynamically.

Tasks:

• Represent seats using Lists

• Model booking system using Classes (OOP)

• Process operations using Loops and Conditional Statements

• Maintain booking records using Dictionaries

• Handle invalid bookings using Exception Handling

• Store data using File Handling

• Display results using String Formatting

Probable Output:

• Seat 2 booked successfully

• Seat 3 booked successfully

• Booking denied for seat 2 (already booked)

• Seat 2 cancellation successful

• Final available seats: [1, 2, 4, 5]


6. WEATHER DATA LOGGER
A weather monitoring station records daily temperatures and wants to analyze unusual patterns.

Temperature readings (°C):


[30, 32, 35, 28, 40, -5]

The system must compute statistics and detect abnormal values (temperature < 0 or > 45).

Tasks:

• Store temperature data using Lists

• Process readings using Loops

• Apply conditions using Conditional Statements

• Compute statistics using Functions

• Identify abnormal values using Nested Conditions

• Save data using File Handling

• Handle invalid inputs using Exception Handling

Probable Output:

• Average temperature: 26.67°C

• Maximum: 40°C

• Minimum: -5°C

• Abnormal reading detected: -5°C

• Summary report displayed

7. E-COMMERCE SHOPPING CART


An online store wants to manage customer purchases.

Products:

• Laptop → ₹50,000

• Mouse → ₹500

Customer actions:

• Add 1 Laptop
• Add 2 Mouse

• Remove 1 Mouse

• Apply ₹1000 discount

Tasks:

• Represent products using Dictionaries

• Maintain cart using Lists

• Perform operations using Functions

• Process updates using Loops and Conditional Statements

• Apply discount using Arithmetic Operations

• Handle invalid operations using Exception Handling

• Store purchase data using File Handling

Probable Output:

• Items: 1 Laptop + 1 Mouse

• Total: ₹50,500

• Discount: ₹1000

• Final payable amount: ₹49,500

8. QUIZ GAME APPLICATION


An educational platform conducts quizzes for students.

Questions:

1. Capital of India → Delhi

2. 5 + 3 → 8

User answers:

• Q1 → Delhi

• Q2 → 10
Tasks:

• Store questions using Lists and Dictionaries

• Process answers using Loops

• Validate responses using Conditional Statements

• Calculate score using Functions

• Handle invalid inputs using Exception Handling

• Save results using File Handling

• Display output using String Formatting

Probable Output:

• Question 1 → Correct

• Question 2 → Incorrect

• Final Score: 1/2

• Correct answers displayed

9. HOSPITAL PATIENT MANAGEMENT SYSTEM


A hospital maintains patient records and appointments.

Initial data:

• ID 1 → Ravi → 10 AM

• ID 2 → Anu → 11 AM

Operations:

• Add patient ID 3 → John → 1 PM

• Update Ravi’s appointment → 12 PM

• Search patient ID 2

Tasks:

• Represent patients using Classes (OOP)

• Store records using Dictionaries

• Process updates using Functions


• Search data using Loops

• Validate entries using Conditional Statements

• Handle errors using Exception Handling

• Save data using File Handling

Probable Output:

• Patient John added successfully

• Ravi updated to 12 PM

• Search result → Anu at 11 AM

• Full patient list displayed

10. EXPENSE TRACKER


A user tracks daily expenses.

Data:

• Food → ₹200

• Travel → ₹500

• Food → ₹300

Tasks:

• Store expenses using Lists and Dictionaries

• Process data using Loops

• Categorize using Conditional Statements

• Compute totals using Functions

• Identify highest expense using Nested Conditions

• Save records using File Handling

• Handle invalid inputs using Exception Handling

Probable Output:

• Total expense: ₹1000


• Food total: ₹500

• Travel total: ₹500

• Highest expense category: Food/Travel

11. TRAIN RESERVATION SYSTEM


Train has 3 seats available.

Operations:

• Passenger A books seat

• Passenger B books seat

• Passenger C books seat

• Passenger D tries booking

Tasks:

• Represent system using Classes (OOP)

• Track seats using Lists

• Process booking using Loops

• Validate using Conditional Statements

• Handle overflow using Exception Handling

• Store bookings using File Handling

• Display summary using String Formatting

Probable Output:

• A, B, C booked successfully

• D added to waiting list

• Final seat status displayed


12. PASSWORD MANAGER
Accounts:

• Gmail → pass123

• Facebook → fb@456

Operations:

• Add Instagram → insta789

• Update Gmail password → newpass

• Retrieve Facebook password

Tasks:

• Store credentials using Dictionaries

• Manage operations using Functions

• Process updates using Conditional Statements

• Handle duplicates using Exception Handling

• Save data using File Handling

• Display results using String Formatting

• Use Loops for operations

Probable Output:

• Instagram added

• Gmail updated

• Facebook password retrieved

• Final account list displayed

13. INVENTORY MANAGEMENT SYSTEM


Products:

• Pen → 10 units

• Notebook → 5 units
Operations:

• Add 5 Pens

• Sell 3 Notebooks

• Sell 10 Notebooks

Tasks:

• Represent inventory using Classes (OOP)

• Store data using Dictionaries

• Update stock using Functions

• Process operations using Loops

• Validate stock using Conditional Statements

• Handle errors using Exception Handling

• Save data using File Handling

Probable Output:

• Pen stock → 15

• Notebook stock → 2

• Sale denied (insufficient stock)

• Final inventory displayed

14. EMAIL CONTACT BOOK


Contacts:

• Ravi → ravi@[Link]

• Anu → anu@[Link]

Operations:

• Add John

• Update Ravi email

• Delete Anu
Tasks:

• Store contacts using Dictionaries

• Manage operations using Functions

• Process updates using Conditional Statements

• Handle invalid inputs using Exception Handling

• Save contacts using File Handling

• Display contacts using String Formatting

• Use Loops for searching

Probable Output:

• John added

• Ravi updated

• Anu deleted

• Final contact list displayed

15. TRAFFIC FINE SYSTEM


Violations:

• Speeding → ₹1000

• No Helmet → ₹500

Records:

• Ravi → Speeding

• Anu → No Helmet

• Ravi → No Helmet

Tasks:

• Store data using Dictionaries and Lists

• Process violations using Loops

• Calculate fines using Functions

• Track repeat offenders using Conditional Statements


• Handle invalid entries using Exception Handling

• Save records using File Handling

• Display report using String Formatting

Probable Output:

• Ravi fine: ₹1500

• Anu fine: ₹500

• Repeat offender: Ravi

• Summary displayed

16. MUSIC PLAYLIST MANAGER


Songs:

• Song A (3 min)

• Song B (4 min)

Operations:

• Add Song C (5 min)

• Remove Song B

• Search Song A

Tasks:

• Represent playlist using Classes (OOP)

• Store songs using Lists

• Process operations using Functions

• Search using Loops

• Validate using Conditional Statements

• Handle duplicates using Exception Handling

• Display output using String Formatting


Probable Output:

• Song C added

• Song B removed

• Song A found

• Total duration: 8 minutes

17. ONLINE COURSE ENROLMENT SYSTEM


Courses:

• Python → 2 seats

Operations:

• Student A enrolls

• Student B enrolls

• Student C tries to enroll

Tasks:

• Represent courses using Classes (OOP)

• Store enrollments using Lists

• Process enrollment using Functions

• Validate seats using Conditional Statements

• Handle overflow using Exception Handling

• Save data using File Handling

• Display summary using String Formatting

Probable Output:

• A and B enrolled

• C denied (no seats)

• Final enrollment list displayed


18. CHAT LOG ANALYZER
Chat data:

• Ravi: Hi

• Anu: Hello

• Ravi: How are you

• Ravi: Bye

Tasks:

• Read data using File Handling

• Store messages using Lists

• Count messages using Loops

• Identify active user using Functions

• Filter data using Conditional Statements

• Handle missing data using Exception Handling

• Display summary using String Formatting

Probable Output:

• Ravi messages: 3

• Anu messages: 1

• Most active: Ravi

19. FLIGHT BOOKING SYSTEM


Flight seats: 2

Operations:

• Passenger A books

• Passenger B books

• Passenger C tries
Tasks:

• Represent system using Classes (OOP)

• Track seats using Lists

• Process booking using Functions

• Validate using Conditional Statements

• Handle overflow using Exception Handling

• Save data using File Handling

• Display summary using String Formatting

Probable Output:

• A and B booked

• C denied

• Final booking list displayed

20. SPORTS TOURNAMENT MANAGER


Matches:

• Team A vs B → A wins

• Team B vs C → C wins

• Team A vs C → A wins

Tasks:

• Represent teams using Classes (OOP)

• Store results using Dictionaries

• Process matches using Loops

• Calculate rankings using Functions

• Validate data using Conditional Statements

• Handle errors using Exception Handling

• Display leaderboard using String Formatting


Probable Output:

• Team A → 2 wins

• Team C → 1 win

• Team B → 0 wins

• Final ranking: A > C > B

21. EMERGENCY ROOM PATIENT QUEUE SYSTEM


A hospital emergency room treats patients based on severity. Patients with higher severity are treated first,
while others wait in a queue.

Patient data:

• Ravi → Severity 2

• Anu → Severity 5

• John → Severity 3

System behavior:

• Patients are added to a waiting queue

• Highest severity patient is treated first

• New patient Meena (Severity 6) arrives

• Next patient is treated

Tasks:

• Implement waiting system using Queue (FIFO concept)

• Prioritize patients using Sorting with Lambda Functions

• Represent patients using Classes (OOP)

• Process data using Loops and Conditional Statements

• Use Functions to manage queue operations

• Handle invalid inputs using Exception Handling

• Store patient records using File Handling


Probable Output:

• Initial order processed → Anu treated first

• Meena added → becomes highest priority

• Meena treated next

• Remaining queue displayed

22. UNDO FEATURE IN TEXT EDITOR


A text editor allows users to perform actions and undo them.

Actions performed:

• Type “Hello”

• Type “World”

• Delete last word

• Undo last action

Tasks:

• Implement undo functionality using Stack (LIFO concept)

• Store actions using Lists

• Process operations using Loops

• Use Functions for action handling

• Apply Conditional Statements for operation control

• Handle invalid undo operations using Exception Handling

• Display text using String Operations and Formatting

Probable Output:

• After typing → “Hello World”

• After delete → “Hello”

• After undo → “Hello World”


23. UNIQUE VISITOR ANALYTICS SYSTEM
A website tracks daily visitors. Multiple visits by the same user should be counted only once.

Visitor log:

• Ravi, Anu, Ravi, John, Anu, Meena

Tasks:

• Store visitors using Sets (to ensure uniqueness)

• Process data using Loops

• Convert data using List and Set operations

• Count unique visitors using Functions

• Use Conditional Statements for filtering

• Save results using File Handling

• Display summary using String Formatting

Probable Output:

• Unique visitors: Ravi, Anu, John, Meena

• Total unique count: 4

24. MATHEMATICAL REPORT GENERATOR


A system generates mathematical reports for given numbers.

Input:

• Number = 5

Operations required:

• Compute factorial

• Generate Fibonacci sequence up to 5

• Calculate square root using math module


Tasks:

• Compute factorial using Recursion

• Generate Fibonacci sequence using Recursion

• Use math module for square root calculation

• Organize logic using Functions

• Handle invalid input using Exception Handling

• Process data using Conditional Statements

• Display output using String Formatting

Probable Output:

• Factorial of 5 → 120

• Fibonacci → 0, 1, 1, 2, 3

• Square root → 2.236

25. ONLINE AUCTION SYSTEM


An online auction system allows multiple bidders to place bids. The highest bidder wins, and in case of a tie,
the winner is chosen randomly.

Bids:

• Ravi → ₹5000

• Anu → ₹7000

• John → ₹7000

Tasks:

• Represent bidders using Classes (OOP)

• Implement base and derived classes using Inheritance

• Apply Polymorphism for bid evaluation

• Use Abstraction to define bidding rules

• Resolve tie using random module

• Process data using Loops and Conditional Statements


• Handle invalid bids using Exception Handling

Probable Output:

• Highest bid: ₹7000

• Tie between Anu and John

• Winner selected randomly (either Anu or John)

• Final winner displayed

You might also like