Write a complete and syntactically correct Python program to solve the following problem: You are the payroll manager for SoftwarePirates Inc. You have been charged with writing a package that calculates the monthly paycheck for the salespeople. Salespeople at SoftwarePirates get paid a base salary of $2000 per month.
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 guideline, I found the same question on here, but I wanted to ask specific questions for myt understanding.
Write a complete and syntactically correct Python
You are the payroll manager for SoftwarePirates Inc. You have been charged with writing
a package that calculates the monthly paycheck for the salespeople. Salespeople at
SoftwarePirates get paid a base salary of $2000 per month. Beyond the base salary,
each salesperson earns commission on the following scale:
Sales Commission Rate Bonus
<$10000 0% 0
$10000 – $100,000 2% 0
$100,001 - $500,000 15% $1000
$500,001 - $1,000,000 28% $5000
>$1,000,000 35% $100,000
Defining my variables:
vacation_days
base_salary
The following additional conditions apply:
1. If a salesperson has taken more than 3 vacation days in a month, their pay gets
reduced by $200
So my initial question is would I create a variable day like:
variable = vacation_days
vacation_days = float(input"please enter no. of Vacation Days.")
So then the user would be prompted for the number of days?
then indented under
if vacation_days>3
base_salary - 200
2. A salesperson earns a bonus only if they have been with the company for 3
months or more
3. For salespeople who have been with the company for 5 years or more and who
have made sales greater than $100,000 an additional bonus of $1000 is added.
All input to the program will be interactive from the keyboard. The output of the program
will include:
a. The name of the salesperson
b. Their longevity with the company
c. Their base salary
d. The commission earned (in Dollars)
e. The bonus earned
f. Additional bonus earned (if any)
g. Deductions (if any)
h. A total gross paycheck
i. Your output should look like a paystub (NOT in paragraph format)
j. All currency should be formatted with a $ sign and 2 decimal places
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
I can understand most of the logic behind the code, but the indentations and organizing is where I get confused. It doesn't display well on Bartleby.
I run the program and it says raw_input isn't defined.
I also get confused with the raw input, as we've only been exposed to float and int input.
Could I modify these to name = float(input("enter your name)
etc. ?
the integer and raw_input part is the only part that sort of confuses me aside from indentation