1.
FLOWCHARTS
1. Electricity Bill Calculation
A residential electricity board wants to help customers understand how their
monthly bill is computed based on slab rates. The system first reads the number
of consumed units and then calculates the total bill: the first 100 units at a basic
rate, the next 100 at a medium rate, and any additional units at a higher rate.
Extra charges such as fixed meter charges must be added at the end. Your task
is to design a flowchart that clearly shows how the units are read, how slab-wise
charges are applied, and how the final amount is calculated.
Question: Draw a flowchart representing the complete bill calculation process.
2. ATM Withdrawal with PIN Validation
Banks frequently automate ATM workflows to reduce customer errors. When a
user inserts an ATM card, the machine prompts for a 4-digit PIN and verifies it
against stored credentials. If the PIN is wrong, the customer gets only three
attempts. After successful login, the customer enters the withdrawal amount,
and the system checks both balance availability and minimum account
requirements.
Question: Draw a flowchart showing PIN validation, withdrawal amount
check, and cash dispensing steps.
3. Vaccination Appointment Scheduling
A health clinic maintains a digital system to schedule vaccination appointments.
The system takes the patient’s age, vaccine type, and preferred date. It must
check vaccine availability, eligible age group, and slot availability. If all
conditions match, the appointment is confirmed; otherwise, an alternative slot is
suggested.
Question: Create a flowchart showing the decision-making process for
assigning a vaccination appointment.
4. Online Food Ordering Workflow
A food delivery app allows users to log in, browse menus, select items, and
place orders. Once an order is placed, the system calculates total cost, adds
taxes, and displays the final bill. The app also verifies if the selected restaurant
is open and if the chosen items are in stock.
Question: Design a flowchart representing the complete food-ordering process
from login to order confirmation.
5. Scholarship Eligibility Check
A college provides scholarships to students based on academic GPA and
attendance percentage. The system accepts these two inputs, verifies if the
student meets both minimum criteria, and classifies eligibility as “Full,”
“Partial,” or “Not Eligible.”
Question: Draw a flowchart that evaluates scholarship eligibility using GPA
and attendance.
6. Automatic Water Tank System
A smart home system uses sensors to maintain water level in overhead tanks.
When the sensor detects that the tank is below a threshold, the motor should
turn ON automatically. Once the water reaches the maximum capacity, the
motor must switch OFF. The process repeats continuously in a loop.
Question: Draw a flowchart showing how sensor readings control the tank
motor.
7. Supermarket Billing with GST
Supermarkets calculate final bill amounts by adding item costs, applying
discounts for members, and adding GST. The system takes multiple items,
calculates subtotal, applies loyalty discounts if applicable, and then adds GST
based on government rules.
Question: Draw a flowchart describing the billing workflow including
discounts and GST.
8. Employee Attendance Tracking
A company wants to automate attendance monitoring. Employees check in and
check out using an RFID card. The system records entry time, exit time, and
calculates total working hours. If hours are below the daily requirement, a
warning is issued.
Question: Create a flowchart that shows the steps for recording and validating
employee attendance.
9. Grade Assignment System
Schools convert raw marks into grades using predefined ranges. When a
student’s marks are entered, the system checks the appropriate range and
assigns grades like A, B, C, D, or F.
Question: Draw a flowchart for assigning grades based on marks input.
10. Traffic Signal Controller
A city traffic department wants a system that controls signals at a four-way
intersection. Each direction gets green for a fixed time followed by yellow and
then red. Pedestrian crossing signals must activate in sync.
Question: Design a flowchart representing traffic light sequencing for all four
directions.
SIMPLE LANGUAGE FEATURES
1. Taxi Fare Calculation
A city taxi company wants to automate the process of calculating how much a
passenger should pay for a ride. The fare depends on a fixed base charge and an
additional cost per kilometer. When a customer enters the distance traveled, the
system must multiply it by the per-km rate and add the base fare to compute the
final amount. It should also ensure negative or invalid distances are not allowed.
The company wants this system integrated into their mobile booking app.
Task: Read base fare and distance, compute final fare.
Question: Write a program to calculate and display the total taxi fare for the
customer.
2. BMI Calculator
A fitness clinic aims to help customers track their health progress by calculating
Body Mass Index (BMI). The software should accept height and weight from
the user, compute BMI using the standard formula, and classify the value into
categories such as Underweight, Normal, Overweight, or Obese. This
information will help trainers create personalized diet and workout plans.
Task: Take height (m) and weight (kg), compute BMI, and classify.
Question: Write a program to compute and interpret BMI for a user.
3. Simple Interest for Bank Customers
A bank provides customers with a digital loan assistant that shows how much
interest they will pay on a loan. The system requires the customer to enter
principal amount, annual interest rate, and loan duration in years. Using this
information, the program should calculate the simple interest and the total
amount payable. This helps customers understand repayment planning clearly
before applying for loans.
Task: Read P, R, T and compute interest and total amount.
Question: Write a program to calculate simple interest for a bank customer.
4. Total Cost of Purchased Items
A supermarket has a self-checkout kiosk where customers scan items
themselves. For each product, the customer enters the quantity and the unit
price. The system must calculate the total amount, including the cost of multiple
items. If the quantity is invalid (zero or negative), it must re-enter. This ensures
accurate billing and reduces cashier workload.
Task: Accept quantity and unit price, compute total cost.
Question: Write a program to calculate the total purchase cost.
5. Temperature Converter for Weather App
A weather application wants to allow users to convert temperatures between
Celsius and Fahrenheit. This helps travelers compare weather conditions across
regions using different measurement systems. The user can enter a value in one
scale, and the program must calculate and show the conversion instantly.
Task: Convert Celsius ↔ Fahrenheit based on user choice.
Question: Write a program to convert temperature values between both scales.
6. Area & Perimeter of Land Plot
A real estate company assists customers in evaluating land plots before
purchase. Buyers frequently ask the area and the boundary length (perimeter) of
rectangular plots. The application must take the plot’s length and width,
compute area and perimeter, and display results clearly. This helps them
compare land value per square foot.
Task: Accept length and width, compute area and perimeter.
Question: Write a program to calculate both area and perimeter of a rectangular
plot.
7. Employee Salary Calculation
A company wants a simple tool to help HR calculate monthly salaries. The
system must take the basic salary and then add allowances such as HRA and
DA. After that, it must subtract deductions like PF and tax to compute the net
salary. This automation reduces calculation errors and speeds up payroll
processing.
Task: Read basic salary, add HRA/DA, subtract deductions, compute net pay.
Question: Write a program to calculate an employee’s net monthly salary.
8. Digital Clock Time Conversion
A smartwatch manufacturer wants to convert raw sensor time data (in seconds)
into a readable format. The watch stores total elapsed seconds during workouts,
and the system should convert this into hours, minutes, and seconds for display.
This helps users understand workout durations more easily.
Task: Convert seconds to hh:mm:ss format.
Question: Write a program that converts given seconds into hours, minutes, and
seconds.
9. Fuel Efficiency Tracker
A vehicle tracking company wants to provide drivers with detailed fuel
analytics. The system allows drivers to enter the distance traveled and the
amount of fuel consumed during the trip. Using these values, fuel efficiency
(km per liter) must be calculated. This helps drivers understand fuel usage and
improve driving habits.
Task: Read distance & fuel used, compute mileage.
Question: Write a program to calculate the fuel efficiency of a vehicle.
10. GST Calculation for Shopping Bills
An online shopping platform wants to display clear tax calculations for each
order. When a customer purchases items, the system should calculate the
subtotal and then apply GST based on current government regulations. The
program must compute the GST amount and the final payable bill.
Task: Accept item cost, apply GST %, compute final cost.
Question: Write a program to calculate GST and total bill for a purchase.
3. Branching Statements (if/else)
1. Odd–Even Traffic Rule Check
Many metropolitan cities follow an odd–even vehicle rule to reduce pollution
and traffic congestion. Vehicles with license plates ending in even numbers are
allowed only on even dates, while those with odd numbers are allowed on odd
dates. A traffic monitoring app wants to check if a vehicle is allowed on the
road on a given day. The user will input the vehicle number and today’s date.
Task: Determine whether the vehicle is permitted on the road.
Question: Write a program using if/else to check if the vehicle can enter the
city roads.
2. Credit Card Eligibility
A bank wants to provide an automated system to verify whether a customer
qualifies for a credit card. The user must enter their monthly income and credit
score. The system should allow approval only if the income meets the minimum
threshold and the credit score is above a required limit. This helps customers
know their eligibility instantly.
Task: Accept income and credit score, check eligibility.
Question: Write a program using if/else to determine credit card qualification.
3. Blood Donation Eligibility
Blood donation camps need to screen volunteers quickly. The system requires
volunteers to enter their age and weight. Only individuals aged 18–65 and
weighing above 50 kg are eligible to donate. If any condition fails, the system
must reject the volunteer politely.
Task: Read age and weight, check donor eligibility.
Question: Write an if/else program to decide if a person is eligible for blood
donation.
4. Login Authentication
An online education platform wants to validate login attempts. The user enters a
username and password, and the system must compare them with stored values.
If both match, access is granted; otherwise, an error message appears. This
ensures security for student accounts.
Task: Take username and password and compare with stored data.
Question: Write a program using if/else for login verification.
5. Water Quality Classification
A water testing system checks pH value to classify water. If the pH is between
6.5 and 8.5, it is safe; between 5.5 and 6.5 or 8.5 and 9.5 it is moderate;
otherwise unsafe. This helps water treatment centers maintain quality standards.
Task: Accept pH and classify water.
Question: Write a program using if/else to categorize water quality.
6. Movie Ticket Category
A cinema booking system wants to categorize ticket types based on age.
Children (below 12), adults (13–59), and seniors (60+) have different fares. The
system must classify the user appropriately after taking the age input.
Task: Read age and determine ticket category.
Question: Write an if/else program to classify movie ticket type.
7. Shipping Cost Category
An e-commerce company charges shipping costs based on package weight.
Lightweight parcels under 1 kg, medium parcels between 1–5 kg, and heavy
parcels above 5 kg have different charges. The system must classify packages
accordingly.
Task: Accept weight and categorize shipping cost slab.
Question: Write a program using if/else to assign shipping category.
8. Premium Member Discount
A shopping app gives additional discounts to premium members. If the user is a
premium member, a 10% discount is applied on the bill; otherwise no discount.
The system should show both the discount and final bill amount.
Task: Read membership status and bill amount, apply discount.
Question: Write an if/else program to calculate final bill after discount.
9. Leap Year Checker
A calendar application needs to determine whether a given year is a leap year so
that February days can be adjusted. A year is leap if divisible by 4 but not by
100, or divisible by 400.
Task: Accept year and apply leap-year rules.
Question: Write an if/else program to check if a year is leap year.
10. Student Pass/Fail Decision
A university requires both theory and lab scores to determine pass status. A
student must score at least 40 in theory and 50 in lab to pass. If either
component is below the minimum, the result should be Fail.
Task: Read theory and lab marks and check status.
Question: Write an if/else program to decide if the student passes or fails.
[Link] Statements
1. 4Daily Compound Interest for n Days
Personal finance apps help users visualize how their savings grow with
interest. When a user inputs the principal amount, daily interest rate, and
number of days, the app should calculate and display the updated balance
for each day. This allows users to see incremental growth due to
compound interest rather than just the final amount, improving financial
planning.
Task: Use a loop to calculate and print daily balances.
Question: Write a program that prints daily compound interest growth
over n days.
2. Monthly EMI Due Dates
Loan management systems notify borrowers about upcoming EMI
payments. Users need a clear list of all EMI due dates for the month, e.g.,
5th, 15th, and 25th. The system should automatically generate these dates
without manual entry. Using loops ensures all due dates are listed in
sequence, helping users avoid missed payments.
Task: Generate EMI due dates using loops.
Question: Write a program to display EMI due dates for a month.
3. Multiplication Table for Students
Educational apps assist students in learning multiplication. A student
enters a number, and the system displays its multiplication table up to 20.
Loops generate each line systematically, making it easier for children to
practice math efficiently.
Task: Use loops to print a multiplication table.
Question: Write a program to generate a multiplication table for a given
number.
4. Countdown Timer for Online Quizzes
Online examination platforms require countdown timers to indicate
remaining time. When a student enters the duration in seconds, the
system decrements and displays the time left until it reaches zero. Loops
manage the countdown automatically, ensuring accurate timing for tests.
Task: Display a countdown timer using loops.
Question: Write a program to simulate a countdown timer for an online
quiz.
5. Prime Numbers for Cybersecurity Keys
Encryption systems rely on prime numbers to generate secure keys. Users
enter a numeric range, and the system identifies all prime numbers within
it. Loops check each number for primality, ensuring the application can
select secure values for cryptographic processes.
Task: Use loops to check and print prime numbers.
Question: Write a program to display all prime numbers within a given
range.
6. Counting Defective Items in a Factory
In manufacturing, workers inspect each produced item and categorize it
as “defective” or “good.” A loop helps tally defective items efficiently
across a batch, enabling quality control teams to monitor production
standards and reduce errors.
Task: Use loops to count defective items.
Question: Write a program to count defective items in a production
batch.
7. Gym Slot Booking Display
A gym operates multiple time slots, some of which are already booked.
When members check availability, the system should loop through all
slots and display only free ones. This helps staff and users efficiently plan
workouts and avoid conflicts.
Task: Use loops to display available slots.
Question: Write a program to list free gym slots for members.
8. Factorial for Scientific Calculators
Scientific calculators often require factorial calculations for mathematical
operations. The system should multiply descending integers from the
user-input number to 1 using a loop, providing quick results for complex
computations in education or engineering contexts.
Task: Use loops to calculate factorial.
Question: Write a program to find the factorial of a given number.
9. Daily Calorie Intake Tracker
Health and fitness apps track calories consumed at breakfast, lunch,
dinner, and snacks. Over multiple days, loops can sum total daily
calories, allowing users to monitor intake and adjust diet plans for
wellness or weight management.
Task: Use loops to sum calories for meals.
Question: Write a program to calculate total daily calorie consumption.
[Link] Rainfall Summary
Meteorological departments record daily rainfall to analyze climate trends
and assist in agricultural planning. Using loops, the system should input
rainfall for 30 days, sum total precipitation, and calculate the monthly
average. This helps farmers and policymakers plan irrigation and crop
strategies effectively.
Task: Use loops to sum daily rainfall and compute monthly averages.
Question: Write a program to compute total and average rainfall for a
month.
.
5. STRING OPERATIONS
1. Extract Username From Email
In modern email platforms like Gmail or Outlook, user identification is
extremely important for personalizing the user experience. When a user logs in,
the system often greets them with their username, but showing the full email
address can be a privacy risk, especially on shared or public computers.
Therefore, the system needs to extract only the portion of the email ID before
the “@” symbol. For example, if the email entered is “[Link]@[Link]”,
the system should extract “[Link]” as the username. This extracted username
can then be used for customized greetings such as “Welcome, John!” or for
displaying in dashboards without revealing the full email. This function is also
widely used in sign-up forms, auto-filling user profiles, and generating display
names. It ensures consistency and avoids unnecessary exposure of personal
data. Email service providers implement this technique to improve both security
and user experience.
Task: Use slicing to extract substring before “@”.
Question: Write a program to extract the username from a given email ID.
2. Password Strength Check
Banking apps and online wallets require strong passwords to safeguard sensitive
financial information. A weak password makes the account vulnerable to
attacks such as brute-force, keylogging, and phishing. To avoid these security
threats, the system must validate the user’s password during sign-up or
password change. The password must meet modern security guidelines: a
minimum of 8 characters, at least one uppercase letter, one digit, and one
special character. The program must evaluate the password using string
operations, indexing, and character checks. The system should provide feedback
such as “Weak Password”, “Moderate Password”, or “Strong Password” based
on the validation rules. This ensures that the banking app enforces good security
practices and protects customer accounts. Such real-time password strength
checking is implemented in apps like Paytm, Google Pay, and SBI Yono.
Task: Use string functions to check password complexity.
Question: Write a program to validate whether a password is strong.
3. Short URL Generator
Short URLs are essential for reducing long website addresses into compact,
shareable links used in social media, SMS, and advertising. Services like Bitly
or TinyURL take a long link and convert it into a short code that uniquely
identifies the source page. For a simple version of this system, the program
should take the first three characters of a website name and combine them with
a random number to create a short code. For example, “[Link]” could
become “fac742”, or “[Link]” could become “ama381”. This shortened
URL can then be easily shared without occupying much space or breaking lines
in messages. Marketers use short URLs to track clicks, while students and
developers use them for quick access to important resources.
Task: Slice the website name and concatenate with random digits.
Question: Write a program to generate a short URL code from a given website
link.
4. Student ID Card Formatter
Educational institutions create digital or printed ID cards for students. These
cards contain important information such as name, department, roll number, and
institution name. To automate ID generation, the system collects user inputs and
formats them into a structured ID card layout. For example, a student entering
“Rahul Sharma”, “CSE”, “21CS045” should get an output like: “Name: Rahul
Sharma | Dept: CSE | Roll No: 21CS045”. String concatenation is used to
combine these inputs cleanly and neatly. This formatted ID is then printed on
physical cards or stored in the database for verification during exams, library
usage, and campus entry. Automating ID creation ensures uniformity and avoids
manual errors.
Task: Use string concatenation to construct ID card details.
Question: Write a program to generate a formatted student ID card string.
5. Mask Credit Card Number
Online shopping platforms like Amazon, Flipkart, and Myntra follow strict
security policies to protect users’ financial details. When a customer saves their
credit card in the app, the system displays only the last four digits for
recognition while masking the rest of the digits to prevent misuse. For example,
a 16-digit card number “9876543210987654” must appear as
“************7654”. To implement this securely, the program must use
slicing to isolate the last four digits and replace the remaining digits with
asterisks. Masking credit card numbers is essential for preventing identity theft
and unauthorized transactions.
Task: Slice and mask the card number.
Question: Write a program to hide all digits of a credit card except the last four.
6. Extract Website Domain
Web browsers and search engines often analyze user-entered URLs to extract
the main domain name. For example, when a user types “[Link]”,
the system needs to extract only “amazon” to display search suggestions, related
categories, or analytics information. This is done by removing the “www.”
prefix and the “.com/.in/.org” suffix using slicing and string splitting. Domain
extraction is used in SEO tools, analytics dashboards, browser history
management, and recommendation systems. It helps identify the brand or
service behind a URL without unnecessary elements.
Task: Use slicing to extract the domain name.
Question: Write a program to extract the domain name from a given website
URL.
7. Count Vowels in a Paragraph
Content analysis tools are widely used in blogging platforms and academic
writing software to analyze readability. One such analysis involves counting the
number of vowels in a paragraph, because a high vowel ratio often indicates
smoother readability. When a user enters a paragraph, the program should scan
through each character and count vowels such as a, e, i, o, and u (both
uppercase and lowercase). This requires iterating through the string and
applying indexing to check each character. Applications like Grammarly, MS
Word, and Google Docs use such string analytics features to guide users on
writing style, keyword density, and clarity.
Task: Count vowels using loops and indexing.
Question: Write a program to count all vowels in a given paragraph.
8. Reformat Date From YYYY-MM-DD
Different countries follow different date formats. For example, India uses “DD-
MM-YYYY” while the US uses “MM-DD-YYYY”. Travel apps, booking
websites, and airline portals must convert dates between formats to match user
preferences. When the user enters a date in “YYYY-MM-DD” format, the
program must extract the year, month, and day using slicing and rearrange them
into “DD-MM-YYYY”. For example, “2025-11-24” should become “24-11-
2025”. This conversion is widely used for hotel booking systems, visa
application websites, travel apps, hospital appointment systems, and student
admission forms.
Task: Slice date components and rearrange.
Question: Write a program to convert a date from “YYYY-MM-DD” to “DD-
MM-YYYY”.
9. Keyword Search in Customer Feedback
Companies analyze customer feedback to identify problems, complaints, and
positive experiences. A program must take the user’s feedback and check if
important keywords like “bad”, “delay”, “refund”, “broken”, “excellent”, or
“support” are present. This detection helps customer service teams prioritize
urgent cases. For example, if the feedback contains the word “refund”, it should
be flagged for the refunds team. Similarly, the word “excellent” can be marked
as positive feedback. String search operations help automate this process
without manual reading of thousands of reviews. Apps like Amazon, Swiggy,
and Zomato use keyword detection to categorize customer sentiments.
Task: Use “in” operator and string search to find keywords.
Question: Write a program to check if specific keywords appear in customer
feedback.
10. Automatic Abbreviation Maker
Organizations, conferences, and institutions often use abbreviations like WHO,
UNICEF, AICTE, and NASA. Creating such abbreviations manually can be
time-consuming when dealing with long names. The program must take a
phrase like “International Business Machines” and extract the first letter of each
word to form “IBM”. This requires splitting the string into words, accessing
their first characters, converting them to uppercase, and concatenating them.
Such a feature is useful for branding teams, documentation systems, certificate
designers, and institutional databases. It ensures uniformity and avoids human
error.
Task: Extract initials from words using string slicing.
Question: Write a program to generate an abbreviation from a multi-word
name.
6.
[Link] GST Billing Function
In a busy city restaurant, customers frequently ask for detailed bills that include
GST and service charges. The restaurant’s billing software needs a function to
compute the final payable amount based on ordered items. The cashier enters
the total pre-tax amount, and the system should automatically apply the GST
percentage defined by government rules. Using a function makes the billing
process consistent and reusable across various ordering modules. Customers
receive bills that show accurate tax calculations, improving transparency. The
system must return the final bill amount after applying GST correctly. This
ensures that both dine-in and online orders follow the same calculation method.
The restaurant needs to avoid manual errors and speed up billing. Using a
function helps centralize the logic.
Task: Create a function that computes total bill including GST.
Question: Write a program with a user-defined function to calculate the final
payable amount after applying GST to a restaurant bill.
2. Age Validation for Movie Tickets
A multiplex cinema hall offers different movie categories such as U, UA, and
A. Before booking a ticket, the system must check if the user’s age is
appropriate for the movie rating. For example, “A” rated movies require the
person to be 18 or older, while children-specific movies require age-based
discounts. A reusable function is necessary so that any booking module—
online, self-kiosk, or counter—can validate customer age quickly and
consistently. Incorrect age validation can cause compliance issues, so
automation is essential. The function must accept the user’s age and required
minimum age for the movie category, and return whether booking should
proceed.
Task: Write a function to validate user age.
Question: Create a user-defined function to check if the user meets age criteria
for movie ticket booking.
3. Maximum Among Three Sensor Readings
Factories and industrial systems use multiple sensors to monitor temperature,
humidity, and pressure. Often, safety alarms depend on the highest sensor
reading among three different sensors. To ensure safe operations, the program
must read three input values and return the maximum reading. A user-defined
function is ideal because various modules may need this logic, such as fire
safety systems, ventilation controls, and data analytics. Identifying the highest
value helps the control system trigger automatic shutdown or initiate cooling
processes.
Task: Use a function to compare three values.
Question: Write a user-defined function that returns the maximum value among
three sensor readings.
4. Vehicle Number Plate Validation
Modern parking systems verify vehicle number plates before allowing entry.
For example, an Indian number plate must follow formats like “KA01AB1234.”
A function is required to check if a given plate matches rules such as length,
uppercase letters, digits, and correct pattern. Manual checking is unreliable, so
automation is necessary for toll gates, parking lots, apartment entries, and
delivery tracking. The system should return “valid” or “invalid” based on
pattern matching.
Task: Implement a function for pattern validation.
Question: Write a program using a function to validate vehicle number plate
formatting.
5. Net Salary Calculator Function
Companies generate employee payslips every month. The payroll department
must compute net salary after deducting PF, tax, and other deductions while
adding HRA, medical allowances, and performance bonuses. Creating a
function helps automate and reuse salary calculations across departments.
Employees get error-free payslips, and HR can process payroll faster. The
function should accept basic salary, allowances, and deductions, and return the
net salary.
Task: Write a user-defined function for salary computation.
Question: Create a function that calculates an employee’s net salary.
6. Kilometers to Miles Converter
Travel and navigation apps require conversions between kilometers and miles
depending on region and user preference. A function should convert input in
kilometers to miles using the formula 1 km = 0.621371 miles. Using a function
helps integrate the logic in route planning, speed monitoring, and distance
estimation.
Task: Create a function for unit conversion.
Question: Write a user-defined function that converts kilometers to miles.
7. OTP Generator Function
Banking and online payment systems frequently generate OTPs for secure
logins and transactions. A function must create a numeric or alphanumeric OTP
based on the length required by the security policy. OTP generation should be
random to prevent fraud. A reusable function helps maintain standard security
practices across the platform.
Task: Create a function to generate random OTPs.
Question: Write a user-defined function to generate OTP of specified length.
8. Grade Determination Function
Schools use grading systems to evaluate students. Based on marks input, a
function should return the grade category such as A, B, C, D, or Fail. The
grading logic must be centralized so all teachers and systems follow the same
evaluation pattern. The function makes result processing accurate, fast, and fair.
Task: Create a function that assigns grades.
Question: Write a program using a function to determine the grade based on
marks.
9. Strong Password Checker Function
Websites require strong passwords containing uppercase letters, lowercase
letters, numbers, and special symbols. To prevent hacking and unauthorized
access, security systems use password validation functions. This function
checks length and complexity before allowing account creation or password
change.
Task: Write a function to check password strength.
Question: Create a user-defined function that validates if a given password is
strong.
10. Digital Clock Increment Function
Electronic devices maintain time using internal clocks. When seconds reach 60,
minutes must increase; when minutes reach 60, hours should increment. A
function is needed to simulate this behavior for smart devices, timer apps, and
digital watches. The function takes hours, minutes, and seconds as input and
returns the incremented time.
Task: Implement a time increment function.
Question: Write a function that simulates digital clock time increment.
[Link]
1. Factorial Computation for Scientific Calculations
In scientific computing, factorial values are required for statistical
computations, probability calculations, and combinatorial problems. For
example, calculating permutations and combinations or evaluating series
expansions in physics requires factorials. Using recursion simplifies the
implementation because the factorial of n can be defined as n * factorial(n-1).
The system should allow a user to input a number and return its factorial using a
recursive approach. Recursive implementation ensures clarity, reduces code
length, and matches the mathematical definition. This is widely used in
calculators, physics simulations, and engineering software.
Task: Implement a recursive function to compute factorial.
Question: Write a recursive program to compute factorial of a given number.
2. Generate Fibonacci Numbers for Financial Forecasting
Financial analysts often use Fibonacci sequences to identify trends and predict
stock movements. The system should generate the first n Fibonacci numbers
using recursion. Recursive functions naturally express the sequence as F(n) =
F(n-1) + F(n-2). The program should allow analysts to see the series for
planning investment strategies. This approach is applicable to economic
simulations, algorithmic trading models, and forecasting applications.
Task: Implement a recursive function to generate Fibonacci numbers.
Question: Write a recursive program to print the first n Fibonacci numbers.
3. Recursive Binary Search in Sorted Contact List
Mobile apps store thousands of contacts in a sorted order. Searching a specific
contact efficiently requires a binary search. Recursive binary search divides the
list repeatedly until the target name is found. This method is faster than linear
search and is commonly used in phone directories, email clients, and CRM
software.
Task: Implement recursive binary search.
Question: Write a program to search for a name in a sorted contact list
recursively.
4. Sum of Digits of Electricity Meter Number
Utility billing systems require sum of digits of electricity meter numbers to
verify checksum or generate unique codes. Using recursion, the sum of digits
can be computed by breaking down the number into last digit and the remaining
number. This method is also used in digital systems for error checking.
Task: Recursively calculate sum of digits.
Question: Write a recursive program to compute the sum of digits of an
electricity meter number.
5. Compute Power (xⁿ) for Encryption Algorithms
Encryption algorithms require calculation of powers like xⁿ for modular
arithmetic or key generation. Recursive functions can compute powers
efficiently using the relation xⁿ = x * xⁿ⁻¹. This is used in cryptography, secure
transactions, and digital certificates.
Task: Implement recursive power function.
Question: Write a recursive program to compute xⁿ.
6. Find Greatest Common Divisor (GCD)
Engineering and mathematical software often require computation of GCD for
simplifying fractions or in signal processing. Using Euclid’s algorithm
recursively allows efficient computation of GCD for large numbers.
Task: Implement recursive GCD calculation.
Question: Write a recursive program to find the GCD of two numbers.
7. Recursively Reverse a Digital Access Code
Security systems may need to reverse codes or strings for encryption checks.
Recursion can reverse a string by combining the last character with the reversed
substring. Applications include access control, digital authentication, and
password validation.
Task: Recursively reverse a string.
Question: Write a recursive program to reverse a digital access code.
8. Compute Total Number of Files in Nested Folders
File management systems must calculate the total number of files in nested
directories for storage analysis. Recursion helps traverse directories and
subdirectories efficiently.
Task: Recursively count files in nested folders.
Question: Write a recursive program to count total files in a nested folder
structure.
9. Solve Tower of Hanoi (Automation Scheduling Task)
Tower of Hanoi is used in scheduling and task automation problems where a
sequence of moves must follow strict rules. Recursive solutions elegantly
handle this puzzle. It is also used to model recursive task dependencies in
automation systems.
Task: Implement recursive Tower of Hanoi.
Question: Write a recursive program to solve the Tower of Hanoi problem.
10. Recursively Determine if a String is a Palindrome
Palindromes are important in text analysis, DNA sequencing, and cybersecurity.
A recursive function can check whether a string reads the same forwards and
backwards by comparing first and last characters and checking the substring.
Task: Recursively check palindrome.
Question: Write a recursive program to determine if a string is a palindrome.
8. File & Module Operations
1. Read Student Records Below Attendance Threshold
Schools and universities maintain digital records of student attendance to
monitor academic progress. A system should read a file containing student
names, IDs, and attendance percentages. The program must filter out students
who have attendance below 75% and display their details. This allows teachers
and administrators to identify at-risk students and issue warnings or schedule
remedial sessions. The data may be in CSV or text format, and the system
should parse it efficiently.
Task: Read the file, filter students, and display records with attendance < 75%.
Question: Write a program to display all students with attendance less than
75% from a file.
2. Log ATM Transactions
Banking applications must log all ATM transactions for security and auditing
purposes. Each transaction includes date, time, account number, transaction
type, and amount. The system should append new transaction records to a log
file without overwriting existing data. These logs are used for reconciliation,
fraud detection, and customer service inquiries.
Task: Append transaction details to a log file.
Question: Implement a program that logs ATM transactions into a file for
future reference.
3. Save Chat Messages to Log File
Messaging applications often store conversation history for users’ access and
backup. Each message includes the sender, receiver, timestamp, and message
content. The system should append new messages to a text file for record-
keeping and offline retrieval. This helps in maintaining conversation archives
and auditing chats in corporate settings.
Task: Append messages with relevant details to a log file.
Question: Write a program to save chat messages into a file with sender and
timestamp.
4. Store Temperature Readings from Sensor
IoT devices generate real-time sensor data such as temperature readings in
industrial or home automation systems. The program should record each
reading along with the timestamp into a file for later analysis. This enables trend
monitoring, alerts for abnormal readings, and historical data analysis. The data
could be stored in text or CSV format.
Task: Write a program to log sensor readings to a file.
Question: Store temperature readings from a sensor into a file with timestamps.
5. Maintain Inventory File and Update Stock
Retail management systems track product stock levels in inventory files. When
items are sold, the system should read the file, update the stock by subtracting
sold quantities, and write the updated values back. This ensures accurate
inventory management, prevents overselling, and aids in automated reordering.
Task: Update inventory file after each transaction.
Question: Write a program to maintain inventory and update stock
dynamically.
6. Read CSV File of Employees and Find Highest Salary
Human resource systems maintain employee data such as name, department,
and salary in CSV files. The program should read the employee data, parse it,
and identify the employee with the highest salary. This can be used for payroll
analysis, promotions, or reporting purposes.
Task: Parse CSV and identify the maximum salary.
Question: Write a program to read employee CSV data and determine the
employee with the highest salary.
7. Import Custom Module to Compute GST
Billing and invoicing software often modularize tax calculations for reusability.
A custom module may contain functions to calculate GST on a given amount.
The main program should import this module and use its functions to compute
the final bill amount including taxes. This approach ensures clean code and easy
updates for tax rules.
Task: Import and use GST functions from a module.
Question: Write a program that imports a GST module and calculates the total
tax for a bill.
8. Append New Customer Entries to Banking Database
Banks maintain customer records in files for account management. The system
should allow new customer details, such as name, account number, and balance,
to be appended to the database file without overwriting existing records. This is
critical for accurate record keeping and account management.
Task: Append new entries to the database file.
Question: Write a program to add new customer details to the banking
database.
9. Read Bus Schedules from File and Display Next Bus
Public transport apps read bus schedules stored in files to provide commuters
with real-time travel information. The program should read the schedule file,
parse times for a given route, and display the next available bus based on the
current time. This helps commuters plan trips efficiently and avoid waiting.
Task: Parse schedule file and display upcoming buses.
Question: Write a program to show the next available bus from a schedule file.
10. Use Utility Module for Password Encryption
Security modules often provide password encryption and hashing functions for
authentication systems. Programs should import these utility modules to secure
passwords before storing them in a database. This is crucial for protecting
sensitive user information in applications like banking, e-commerce, and
messaging services.
Task: Import encryption module and encrypt passwords.
Question: Write a program that uses a utility module to encrypt passwords
before storage.
9. List & Tuple Operations
[Link] apps collect daily temperature readings from various cities. Users
want to view weekly averages to understand climate trends or plan activities. A
system should store daily temperatures in a list, then compute the weekly
average for reporting. This allows easy addition or removal of daily readings
and supports statistical calculations for weather forecasts.
Task: Store readings in a list and compute average.
Question: Write a program to store daily temperatures in a list and calculate
weekly averages for reporting.
2. Maintain Shopping Cart Items
E-commerce platforms allow customers to add or remove products from a
shopping cart before checkout. The cart needs to dynamically update the list of
items, reflecting additions and removals, to compute total cost accurately.
Managing a shopping cart through lists ensures order tracking and inventory
updates.
Task: Update shopping cart list on addition/removal.
Question: Write a program to maintain a shopping cart using lists, allowing
dynamic add/remove operations.
3. Track Patient Vitals Using Tuples
Hospitals store patient vitals such as pulse rate, blood pressure, and sugar levels
in tuples. Tuples are immutable, preserving historical health data without
accidental changes. Doctors and nurses use these records for monitoring patient
conditions over time.
Task: Store and retrieve patient vitals using tuples.
Question: Write a program to store patient vitals in tuples and display them
safely.
4. Store Student Grades and Find Class Topper
Schools track student grades in lists or tuples. The system should compute the
highest marks in a class to identify toppers and generate reports for awards or
merit lists. Lists or tuples allow easy processing and aggregation of marks.
Task: Analyze grades and identify the topper.
Question: Write a program to find the student with the highest marks from a list
of grades.
5. Manage To-Do List App
Productivity apps manage user tasks in lists. Users can insert, delete, and search
tasks to track daily activities efficiently. Proper list management ensures tasks
are up-to-date and deadlines are met.
Task: Perform insert, delete, and search operations on a task list.
Question: Write a program to manage a to-do list using lists, supporting CRUD
operations.
6. Sort Product Prices
E-commerce apps compare product prices to recommend the cheapest or
costliest items. Sorting a list of prices allows fast access to extremes and assists
users in decision-making.
Task: Sort prices to find cheapest and costliest products.
Question: Write a program to sort product prices and display the cheapest and
costliest options.
7. Maintain Completed and Pending Tasks
Project management systems track completed and pending tasks in lists to
monitor progress and allocate resources effectively. Separating tasks ensures
better reporting and project planning.
Task: Separate tasks into completed and pending lists.
Question: Write a program to track completed and pending tasks using lists.
8. Analyze Rainfall Data Stored in Tuple
Environmental monitoring stations store daily rainfall in tuples for
immutability. Summarizing these readings provides monthly or yearly totals,
essential for flood prediction or agriculture planning.
Task: Calculate total rainfall using tuples.
Question: Write a program to sum rainfall readings stored in a tuple for
analysis.
9. Identify Duplicate Entries in Attendance List
Organizations maintain attendance records in lists. Duplicates can indicate
errors, misreporting, or fraud. Detecting duplicates helps maintain accurate
records and ensures compliance with policies.
Task: Identify duplicates in a list.
Question: Write a program to find duplicate entries in an attendance list.
10. Split Sentence Into Words for Keyword Analysis
Text analytics require splitting sentences into individual words for counting
occurrences or detecting keywords. This is used in customer feedback analysis,
search optimization, or sentiment analysis.
Task: Use string split and store in a list.
Question: Write a program to split a sentence into words for keyword analysis.
1. 10. Store Product Details in Supermarket
Supermarkets handle thousands of products daily. Each product has a
name, price, and available stock. Accurate tracking is essential for billing
customers, managing inventory, and planning restocking. When a product
is sold, the stock must decrease automatically, and new products should
be added easily. Using dictionaries allows storing product details as key-
value pairs for quick access and update.
Task: Store product details and update quantities dynamically.
Question: Write a Python program to store product names, prices, and
stock in a dictionary and update quantities after each sale.
2. Employee Records Search by ID
Companies employ hundreds of staff members. Each employee has a
unique ID, name, department, and salary. HR departments often need to
quickly search for an employee’s record by ID to process payroll, track
performance, or manage promotions. Dictionaries are ideal for fast
lookup using employee IDs as keys.
Task: Search employee records using employee IDs.
Question: Write a program to search employee details by ID using a
dictionary.
3. Count Word Frequency in Customer Reviews
E-commerce platforms receive thousands of customer reviews daily.
Identifying frequently mentioned words like “excellent,” “slow,” or
“refund” helps businesses improve products and services. Dictionaries
can store words as keys and their counts as values for efficient analysis.
Task: Count the frequency of each word in customer reviews.
Question: Write a program to analyze a set of customer reviews and
display word frequency using a dictionary.
4. Maintain Contact List Without Duplicates Using Sets
Messaging and social media apps store millions of contacts. Duplicate
contacts waste memory and create confusion. Sets automatically
eliminate duplicates and allow efficient addition and search operations.
Task: Maintain a contact list with unique entries.
Question: Write a program to store and manage unique contacts using
sets.
5. Track Student Marks in Multiple Subjects
Schools maintain student academic records for grading and reporting.
Each student has marks for multiple subjects, and totals and averages
must be calculated for performance analysis. Dictionaries allow storing
subjects and marks for each student efficiently.
Task: Store student marks and compute total and average.
Question: Write a program to store marks for multiple subjects for each
student and calculate their total and average using dictionaries.
6. Identify Unique Website Visitors
Websites track visitor activity for analytics and marketing. Counting each
unique visitor is critical to understanding traffic trends. Sets store visitor
IDs efficiently and automatically remove duplicate entries.
Task: Track unique visitors on a website.
Question: Write a program to store and count unique website visitors
using sets.
7. Map Course Codes to Course Names in College System
Colleges manage hundreds of courses. Each course has a unique code
mapped to a descriptive name. Students and staff need to quickly retrieve
course details using course codes. Dictionaries allow easy mapping and
retrieval.
Task: Map course codes to course names.
Question: Write a program to retrieve course names using course codes
stored in a dictionary.
8. Detect Duplicate Transactions Using Sets
Banking systems record millions of transactions daily. Duplicate
transaction IDs indicate errors or fraud. Sets allow storing transaction IDs
efficiently and identifying duplicates instantly.
Task: Identify duplicate transaction IDs.
Question: Write a program to detect duplicate transaction IDs using sets.
9. Build a Currency Conversion Dictionary
Financial apps provide real-time currency conversions. Exchange rates
are stored in dictionaries for efficient lookup. Users can quickly convert
amounts between currencies using stored rates.
Task: Store currency exchange rates and perform conversions.
Question: Write a program to convert amounts between currencies using
a dictionary of exchange rates.
[Link] Inventory Using Dictionaries and Update Quantities
Retailers track inventory to avoid stockouts and overselling. Each product
has a name, price, and quantity. Dictionaries allow real-time updating of
inventory as sales occur and new stock is added.
Task: Maintain and update product inventory dynamically.
Question: Write a program to manage supermarket inventory using
dictionaries and update quantities after each sale.