0% found this document useful (0 votes)
6 views4 pages

Day 2 Ps

Uploaded by

demow26767
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Day 2 Ps

Uploaded by

demow26767
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Problem Statement 1: Employee Performance Evaluation

You are tasked with developing a program that evaluates the performance of employees based on
their work hours, project completion, and attendance. The program should determine the
performance rating and eligibility for a bonus.

Eligibility Criteria:

The program determines the performance rating and bonus eligibility based on the following
conditions:

 Employees must have worked at least 160 hours in a month.


 Employees must have completed at least 5 projects.
 Employees must have an attendance rate of at least 90%.

Input:

Your program should read three inputs:

 Total work hours in a month (integer).


 Number of projects completed (integer).
 Attendance rate (percentage as an integer).

Output:

 The program should output the performance rating as "Excellent", "Good", or "Needs
Improvement".
 The program should output 1 if the employee is eligible for a bonus, and 0 if not.

Example:

Input:

170
6
95

Output:

Excellent
1

Problem Statement 2: Smart Home Temperature Control

You are tasked with developing a program that controls the temperature of a smart home based
on the current temperature, time of day, and user preferences. The program should adjust the
temperature accordingly.

Control Criteria:
The program adjusts the temperature based on the following conditions:

 If the current temperature is below 18°C and it's night time (8 PM to 6 AM), increase the
temperature by 5°C.
 If the current temperature is above 24°C and it's day time (6 AM to 8 PM), decrease the
temperature by 3°C.
 If the current temperature is within the range of 18°C to 24°C, maintain the current
temperature.

Input:

Your program should read two inputs:

 Current temperature (integer).


 Current time in 24-hour format (integer).

Output:

 The program should output the adjusted temperature.

Example:

Input:

16
22

Output:

21

Problem Statement 3: Online Shopping Discount Calculator

You are tasked with developing a program that calculates the final price of items in an online
shopping cart after applying various discounts and taxes. The program should handle multiple
items and apply discounts based on the total amount.

Discount and Tax Criteria:

The program calculates the final price based on the following conditions:

 If the total amount is greater than $500, apply a 10% discount.


 If the total amount is between $200 and $500, apply a 5% discount.
 Apply a sales tax of 8% on the discounted amount.

Input:

Your program should read a list of item prices (floating-point numbers).

Output:
 The program should output the final price after applying discounts and taxes.

Example:

Input:

[150.0, 200.0, 180.0]

Output:

486.72

Problem Statement 4: Student Grade Calculator

You are tasked with developing a program that calculates the final grade of a student based on
their scores in multiple subjects and applies various conditions to determine the final grade. The
program should also apply penalties for low attendance and bonuses for extracurricular activities.

Input:

 The program should accept the following inputs:


1. A list of scores for five subjects (integers between 0 and 100).
2. The attendance percentage (integer between 0 and 100).
3. The number of extracurricular activities participated in (integer).

Output:

 The program should display the final grade as a percentage.

Conditions:

1. Calculate the average score of the five subjects.


2. Apply a penalty to the average score based on attendance:
o If attendance is below 75%, reduce the average score by 10%.
o If attendance is between 75% and 90%, reduce the average score by 5%.
o If attendance is above 90%, no penalty is applied.
3. Apply a bonus to the average score based on extracurricular activities:
o If the student participated in 3 or more activities, add 5% to the average score.
o If the student participated in 1 or 2 activities, add 2% to the average score.
o If the student did not participate in any activities, no bonus is applied.
4. Ensure that the final grade does not exceed 100%.

Example:

Input:

[85, 90, 78, 92, 88]


95
2

Output:
87.6

Problem Statement 5: Associativity in Mathematical Expressions

You are tasked with developing a program that evaluates a mathematical expression based on the
associativity of operators. The program should correctly handle the order of operations and
associativity rules.

Input:

Your program should read a mathematical expression as a string.

Output:

 The program should output the evaluated result of the expression.

Example:

Input:

"3 + 5 * 2 ** 2"

Output:

23

You might also like