In: Computer Science
Create a file named sales_bonus.py
2. Prompt the user for the amount of sales made, convert to a float, and assign to sales.
3. Prompt the user for number of days missed, covert to an int, and assign to days_missed
4. If the user have more than 3000 of sales and has missed less than or equal to two days of work, assign bonus to 100.
5. Else if the user have more than 3000 of sales or has missed less than or equal to one day of work, assign bonus to 50.
6. Otherwise, assign a bonus of 0.
7. Print out the bonus with two decimal places of precision.
import math
# input the number of sales
sales=float(input('Enter the amount of sales made: '))
# input the number of days missed
days_missed=int(input('Enter the number of days missed: '))
#initialise the bonus
bonus=0
#apply the required conditions
if sales>3000 and days_missed<=2:
bonus=100
elif sales>3000 or days_missed<=1:
bonus=50
#convert the bonus to float and print it
bonus=float(bonus)
print('The bonus is: ')
print ('%.2f'%bonus)
PLEASE LIKE THE SOLUTION :))
IF YOU HAVE ANY DOUBTS PLEASE MENTION IN THE COMMENT