Day 2 Ps
Day 2 Ps
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:
Input:
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
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:
Output:
Example:
Input:
16
22
Output:
21
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.
The program calculates the final price based on the following conditions:
Input:
Output:
The program should output the final price after applying discounts and taxes.
Example:
Input:
Output:
486.72
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:
Output:
Conditions:
Example:
Input:
Output:
87.6
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:
Output:
Example:
Input:
"3 + 5 * 2 ** 2"
Output:
23