Question

Multiple Conditional Statements Summary In this lab, you complete a Python program that calculates an employee's...

Multiple Conditional Statements

Summary In this lab, you complete a Python program that calculates an employee's annual bonus. Input is an employee's first name, last name, salary, and numeric performance rating. If the rating is 1, 2, or 3, the bonus rate used is .25, .15, or .1 respectively. If the rating is 4 or higher, the rate is 0. The employee bonus is calculated by multiplying the bonus rate by the annual salary.

  1. Variables have been declared for you, and the input statements and output statements have been written. Read them over carefully before you proceed to the next step.
  2. Design the logic, and write the rest of the program using if - elif statements.
  3. Execute the program entering the following as input:
    Jeanne Hanson
    70000.00
    2
  4. Confirm that your output matches the following:
    Employee Name: Jeanne Hanson
    Employee Bonus: $10500

Grading

When you have completed your program, click the Submit button to record your score.

  • # Declare and initialize variables here
    BONUS_1 = 0.25
    BONUS_2 = 0.15
    BONUS_3 = 0.1
    NO_BONUS = 0

    RATING_1 = 1
    RATING_2 = 2
    RATING_3 = 3

    employeeFirstName = input("Enter employee's first name: ")
    employeeLastName = input("Enter employee's last name: ")
    employeeSalary = float(input("Enter the employee's yearly salary: "))
    employeeRating = int(input("Enter employee's performance rating: "))

    # Write your code here

    # Output bonus here

    print("Employee Name: " + employeeFirstName + " " + employeeLastName)
    print("Employee Bonus: $" + str(bonus))

0 0
Add a comment Improve this question Transcribed image text
Answer #1
# Declare and initialize variables here
BONUS_1 = 0.25
BONUS_2 = 0.15
BONUS_3 = 0.1
NO_BONUS = 0

RATING_1 = 1
RATING_2 = 2
RATING_3 = 3

employeeFirstName = input("Enter employee's first name: ")
employeeLastName = input("Enter employee's last name: ")
employeeSalary = float(input("Enter the employee's yearly salary: "))
employeeRating = int(input("Enter employee's performance rating: "))

bonus = 0
if(employeeRating==RATING_1):
    bonus = employeeSalary * BONUS_1
elif(employeeRating==RATING_2):
    bonus = employeeSalary * BONUS_2
elif(employeeRating==RATING_3):
    bonus = employeeSalary * BONUS_3


# Output bonus here

print("Employee Name: " + employeeFirstName + " " + employeeLastName)
print("Employee Bonus: $" + str(bonus))

Add a comment
Know the answer?
Add Answer to:
Multiple Conditional Statements Summary In this lab, you complete a Python program that calculates an employee's...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In this lab, you complete a prewritten C++ program that calculates an employee’s productivity bonus and...

    In this lab, you complete a prewritten C++ program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. Bonuses are calculated based on an employee’s productivity score as shown below. A productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked. Productivity Score Bonus <=30 $50 31–69 $75 70–199 $100 >= 200 $200 Instructions Ensure the file named...

  • Propose: In this lab, you will complete a Python program with one partner. This lab will...

    Propose: In this lab, you will complete a Python program with one partner. This lab will help you with the practice modularizing a Python program. Instructions (Ask for guidance if necessary): To speed up the process, follow these steps. Download the ###_###lastnamelab4.py onto your desktop (use your class codes for ### and your last name) Launch Pyscripter and open the .py file from within Pyscripter. The code is already included in a form without any functions. Look it over carefully....

  • Swapping Values in python Summary In this lab, you complete a Python program that swaps values...

    Swapping Values in python Summary In this lab, you complete a Python program that swaps values stored in three variables and determines maximum and minimum values. The Python file provided for this lab contains the necessary input and output statements. You want to end up with the smallest value stored in the variable named first and the largest value stored in the variable named third. You need to write the statements that compare the values and swap them if appropriate....

  • In this lab, you complete a prewritten C++ program that calculates an employee's productivity bonus and prints the employee's name and bonus

    SummaryIn this lab, you complete a prewritten C++ program that calculates an employee's productivity bonus and prints the employee's name and bonus. Bonuses are calculated based on an employee's productivity score as shown below. A productivity score is calculated by first dividing an employee's transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.       

  • please help, In this lab, you complete a C++ program with the provided data files. The program calculates the amount of...

    please help, In this lab, you complete a C++ program with the provided data files. The program calculates the amount of tax withheld from an employee’s weekly salary, the tax deduction to which the employee is entitled for each dependent, and the employee’s take- home pay. The program output includes state tax withheld, federal tax withheld, dependent tax deductions, salary, and take-home pay. Instructions Ensure the source code file named Payroll.cpp is open in the code editor. Variables have been...

  • Please write the following program in Java That last idea at PicoSoft didn't work out too...

    Please write the following program in Java That last idea at PicoSoft didn't work out too well … management has a massive public relations disaster on their hands, and thus they decide to revise the bonus structure, as well as give eveyone some additional vacation time. Write a program that reads in (from the keyboard) the following information about an employee: Last name First name Years worked (a whole number) Annual salary An employee's vacation time is based upon the...

  • ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for...

    ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for employees. Specifications Create an abstract Employee class that provides private attributes for the first name, last name, email address, and social security number. This class should provide functions that set and return the employee’s first name, last name, email address, and social security number. This class has a function: get_net_income which returns 0. Create a Manager class that inherits the Employee class. This class...

  • unctions with No Parameters Summary In this lab, you complete a partially prewritten Python program that...

    unctions with No Parameters Summary In this lab, you complete a partially prewritten Python program that includes a function with no parameters. The program asks the user if they have preregistered for art show tickets. If the user has preregistered, the program should call a function named discount() that displays the message "You are preregistered and qualify for a 5% discount." If the user has not preregistered, the program should call a function named noDiscount() that displays the message "Sorry,...

  • Use python and use if, elif and else statements. Thank you! The program should first ask...

    Use python and use if, elif and else statements. Thank you! The program should first ask the user if they are a hero or a villain. If they enter “villain”, the program should ask them their name; if they enter “hero”, it should ask how many people they have saved, and respond to that information. Using decision structures, have your program execute certain print statements following these rules: If they enter that they are a villain Ask for their name...

  • Program description: Write the necessary C++ statements (Program) to calculate the employee's weekly pay. Where :...

    Program description: Write the necessary C++ statements (Program) to calculate the employee's weekly pay. Where : Hour = employee's work hours Rate = employee's hourly pay Wages = employee's weekly pay Given that ( Hour= 31.5 and , Rate = $11.45) Write the variable declarations and initialization sections necessary to compute and print the required calculations. The program should ask the user to input the hours and Rate of pay, then calculate the weekly Wages. Hint: Modify program in project...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT