Here is the what im writing: The error starts at the second line. Im using Spyder/anaconda to write python 3.8 def getBonus(salary, bonusPercent): salary = readFloat("Please enter your salary:") print ("Please enter your salary:") bonusPercent = getBonus(salary, bonusPercent) print ("Please enter your bonus percentage:") Here is the problem: Write a Python function def getBonus(salary, bonusPercent) The function you write should be named getBonus, and it should accept an employee’s salary and the bonus they have been granted, and then return the bonus amount. The salary, bonusPercent, and bonusAmount should all be float type.
Operations
In mathematics and computer science, an operation is an event that is carried out to satisfy a given task. Basic operations of a computer system are input, processing, output, storage, and control.
Basic Operators
An operator is a symbol that indicates an operation to be performed. We are familiar with operators in mathematics; operators used in computer programming are—in many ways—similar to mathematical operators.
Division Operator
We all learnt about division—and the division operator—in school. You probably know of both these symbols as representing division:
Modulus Operator
Modulus can be represented either as (mod or modulo) in computing operation. Modulus comes under arithmetic operations. Any number or variable which produces absolute value is modulus functionality. Magnitude of any function is totally changed by modulo operator as it changes even negative value to positive.
Operators
In the realm of programming, operators refer to the symbols that perform some function. They are tasked with instructing the compiler on the type of action that needs to be performed on the values passed as operands. Operators can be used in mathematical formulas and equations. In programming languages like Python, C, and Java, a variety of operators are defined.
Here is the what im writing: The error starts at the second line. Im using Spyder/anaconda to write python 3.8
def getBonus(salary, bonusPercent):
salary = readFloat("Please enter your salary:")
print ("Please enter your salary:")
bonusPercent = getBonus(salary, bonusPercent)
print ("Please enter your bonus percentage:")
Here is the problem:
- Write a Python function def getBonus(salary, bonusPercent)
The function you write should be named getBonus, and it should accept an employee’s salary and the bonus they have been granted, and then return the bonus amount. The salary, bonusPercent, and bonusAmount should all be float type.
Here are some examples of typical usage:
salary = readFloat(“Please enter your salary:”)
xmasBonus = getBonus(50000, 0.04)
- Using the getBonus function that you wrote for part a, write a Python program that will ask for a series of employee IDs, salaries, and bonus percentages. When the user is done inputting employees, the user will enter “-1” for the employee ID, and the system will then print out the employeeID, the salary, bonus percentage, and bonus amount for each employee, as well as the number of employees that were processed, the total amount of bonuses, and the average employee bonus amount.
employeeID |
salary |
bonusPercent |
900111 |
50000 |
10% |
900222 |
34000 |
7% |
900333 |
39000 |
8% |
900444 |
43000 |
11.50% |
Trending now
This is a popular solution!
Step by step
Solved in 2 steps