Problem Set
Problem 1: Printing a Message
Problem Statement:
Write a Python program that prints the message:
"Hello, welcome to BBA program!".
Input:
No input is required.
Output:
Print the message as specified:
"Hello, welcome to BBA program!".
Example:
Input Output
No input Hello, welcome to BBA program!
Problem 2: Salary Calculation with Bonus
Problem Statement:
A company gives a monthly bonus to employees based on their performance. If an employee’s
performance score is above 80, they receive a bonus of $1000. If their performance score is
between 50 and 80, they get a bonus of $500. If it’s below 50, no bonus is given. Write a program
to calculate the total monthly income of an employee, including their base salary and bonus.
Input:
• The first line contains a floating-point number salary (1000 ≤ salary ≤ 100000),
representing the employee's base salary.
• The second line contains an integer score (0 ≤ score ≤ 100), representing the employee's
performance score.
Output:
• Print the total monthly income of the employee, rounded to 2 decimal places.
Example:
Input Output
3000 4000.00
85
4500 5000.00
70
3200 3200.00
40
Problem 3: Check Attendance for Meeting
Problem Statement:
A company is organizing a team meeting. If an employee is on time (i.e., they arrive before the
scheduled time), they are marked as "Present" for the meeting. If they are late, they are marked as
"Late". Write a program to check whether an employee is on time based on the time they arrive
and the scheduled meeting time.
Input:
• The first line contains two integers: hour and minute (0 ≤ hour ≤ 23, 0 ≤ minute ≤ 59),
representing the time the employee arrives.
• The second line contains two integers: scheduled_hour and scheduled_minute (0 ≤
scheduled_hour ≤ 23, 0 ≤ scheduled_minute ≤ 59), representing the scheduled meeting
time.
Output:
• If the employee is on time (arrives before or exactly at the scheduled time), print "On
time".
• If the employee is late, print "Late".
Example:
Input Output
9 30 On time
9 45
10 10 Late
9 45
8 55 On time
9 00
Problem 4: Shopping Cart Total Calculation
Problem Statement:
Write a Python program to calculate the total cost of a shopping cart. The cart contains different
items with their prices. You are given the price of each item and the quantity purchased. The
program should compute the total cost.
Input:
• The first line contains an integer n (1 ≤ n ≤ 100), representing the number of different
items in the shopping cart.
• The following n lines each contain two space-separated integers: price (1 ≤ price ≤
10000) and quantity (1 ≤ quantity ≤ 100), representing the price and quantity of each
item.
Output:
• Print the total cost of the shopping cart.
Example:
Input Output
3 600
100 2
200 1
50 4
2 750
300 1
150 3
1 1000
500 2
Problem 5: Task Priority Check
Problem Statement:
In a company, tasks are assigned priority levels. If the task has a priority level greater than 5, it is
considered "High Priority", otherwise, it is "Low Priority". Write a program to check if a task is
high priority or low priority based on the given priority level.
Input:
• A single integer priority_level (1 ≤ priority_level ≤ 10) representing the priority level of
the task.
Output:
• If the priority_level is greater than 5, print "High Priority".
• Otherwise, print "Low Priority".
Example:
Input Output
6 High Priority
3 Low Priority
5 Low Priority
Problem 6: Customer Feedback Response
Problem Statement:
Write a Python program to process customer feedback. If a customer rates the service as 5 or 4,
print "Thank you for your positive feedback!". If the rating is 3, print "We appreciate your
feedback!". Otherwise, print "Sorry to hear that. We will try to improve.".
Input:
• A single integer rating (1 ≤ rating ≤ 5) representing the customer’s feedback.
Output:
• Print the appropriate response based on the rating.
Example:
Input Output
5 Thank you for your positive feedback!
3 We appreciate your feedback!
2 Sorry to hear that. We will try to improve.
Problem 7: Employee Working Hours
Problem Statement:
An employee works for a company, and their weekly working hours are recorded. If they work
more than 40 hours in a week, they are eligible for overtime pay. Write a program to determine if
an employee is eligible for overtime pay based on the number of hours worked in a week.
Input:
• A single integer hours_worked (0 ≤ hours_worked ≤ 100) representing the total hours
worked by the employee in a week.
Output:
• Print "Eligible for overtime" if the employee worked more than 40 hours.
• Otherwise, print "Not eligible for overtime".
Example:
Input Output
45 Eligible for overtime
35 Not eligible for overtime
40 Not eligible for overtime
Problem 8: Product Inventory Management
Problem Statement:
You are working in the inventory management department of a retail company. Your task is to
calculate the total number of products in stock based on a given list of items. Each item has a
quantity, and you need to sum up all the quantities to get the total number of products.
Write a Python program that uses a loop to calculate the total number of products in stock.
Input:
• The first line contains an integer n (1 ≤ n ≤ 100), representing the number of different
products in the inventory.
• The next n lines each contain a single integer quantity (1 ≤ quantity ≤ 1000), representing
the quantity of each product in stock.
Output:
• Print the total number of products in stock.
Example:
Input Output
3 35
10
20
Explanation:
There are 3 products in stock with quantities 10, 5, and 20, so the total number of products is
10 + 5 + 20 = 35.
Input Output
4 20
2
10
5 5