Question

In: Computer Science

The first assignment involves writing a Python program to compute the weekly pay for a salesman....

The first assignment involves writing a Python program to compute the weekly pay for a salesman. Your program should prompt the user for the number of hours worked for that week and the weekly sales. Your program should compute the total pay as the sum of the pay based on the number of hours worked times the hourly rate plus the commission. You should choose a value for the hourly pay. The commission should be computed as a percentage of the weekly sales. You should choose a value for the percentage. Your program should output the pay based on the hours worked, the commission and the total pay for the week.

Your program should include the pseudocode, used to come up with the program statements, in the comments. Document the values you chose for the hourly rate and commission percentage in your comments as well.

You are to submit your Python program as a text file (.txt) file. In addition, you are also to submit a test report in a Word document or a .pdf file. 15% of your grade will be based on whether the comments in your program include the pseudocode and define the values of your constants, 70% on whether your program executes correctly on all test cases and 15% on the completeness of your test report.

Solutions

Expert Solution

Answer:

Here is the python code as per your requirement

Raw code:

#taking hours as input from the user

hours=int(input("Number of hours: "))

#taking weekly sales as input from user in float

weeklySales=float(input("Weekly Sales: "))

#let the hourly rate be 40 change it according to ur wish

hourlyRate=40

#let the commission percentage is 15 change it according to ur wish

commissionPercentage=15

#calculate the commision earned

weeklyCommission=(commissionPercentage/weeklySales)*100

#calculate the hourly pay

hourlyPay=hourlyRate*40

#calculating total pay by adding hourly rate earned and weekly commission

totalSales=hourlyPay+weeklyCommission

#printing the mto user

print("Pay for working hours: {}".format(hourlyPay))

print("Commission pay: {}".format(weeklyCommission))

print("Totla pay: {}".format(totalSales))

Editor:

output:

Hope this helps you! If you still have any doubts or queries please feel free to comment in the comment section.

"Please refer to the screenshot of the code to understand the indentation of the code".

Thank you! Do upvote.


Related Solutions

The second assignment involves writing a Python program to compute the price of a theater ticket....
The second assignment involves writing a Python program to compute the price of a theater ticket. Your program should prompt the user for the patron's age and whether the movie is 3D. Children and seniors should receive a discounted price. There should be a surcharge for movies that are 3D. You should decide on the age cutoffs for children and seniors and the prices for the three different age groups. You should also decide on the amount of the surcharge...
The sixth assignment involves writing a Python program to read in the temperatures for ten consecutive...
The sixth assignment involves writing a Python program to read in the temperatures for ten consecutive days in Celsius and store them into an array. The entire array should then be displayed. Next each temperature in the array should be converted to Fahrenheit and the entire array should be again be displayed. The formula for converting Celsius to Fahrenheit is °F = (°C × 1.8) + 32. Finally, the number of cool, warm and hot days should be counted and...
This involves writing a Python program to determine the body-mass index of a collection of six...
This involves writing a Python program to determine the body-mass index of a collection of six individuals. Your program should include a list of six names. Using a for loop, it should successively prompt the user for the height in inches and weight in pounds of each individual. Each prompt should include the name of the individual whose height and weight is to be input. It should call a function that accepts the height and weight as parameters and returns...
***In Java language***The first programming project involves writing a program that computes the salaries for a...
***In Java language***The first programming project involves writing a program that computes the salaries for a collection of employees of different types. This program consists of four classes. 1. The first class is the Employee class, which contains the employee's name and monthly salary, which is specified in whole dollars. It should have three methods: a. A constructor that allows the name and monthly salary to be initialized. b. A method named annualSalary that returns the salary for a whole...
[PYTHON] Modify the examaverages.py program included with this assignment so it will also compute the overall...
[PYTHON] Modify the examaverages.py program included with this assignment so it will also compute the overall average test grade. E.g if there are 3 test each student must take and the user enters the following set of test scores for the two students…: 30, 40, 50 for the first student 50, 60, 70 for the second student …then program will print the average for each student (i.e. 40 for the first student and 60 for the second student – the...
Python 1. A salesman can sell five different items. Write a program that lets the salesman...
Python 1. A salesman can sell five different items. Write a program that lets the salesman enter the quantity of each item sold, calculates the total sales, and prints as below. Use a for loop to ask the salesman how many of each product he sold. tem 1 $2.50 Item 2 $1.98 Item 3 $5.75 Item 4 $3.45 Item 5 $4.00 2. Rewrite program #1 using a for loop to run for 3 salesmen and print the total sales for...
The program you will be writing displays a weekly payroll report. A loop in the program...
The program you will be writing displays a weekly payroll report. A loop in the program should ask the user for the employee's number, last name, worked hours, hourly pay rate, state tax and federal tax rate. After data in entered and the user hits the enter key, the program will calculate gross an net pay, then displays all employee's payroll information, and ask for the next employees' information. if worked hour is more than 40, double pay the hours...
Compute the deductions, net pay, and accumulated gross earnings for each weekly pay period. Assume that...
Compute the deductions, net pay, and accumulated gross earnings for each weekly pay period. Assume that Joseph is single and that $28.25 was withheld for medical insurance (pre-tax) and $20 for his United Way contribution. Use the wage bracket method to determine federal income tax. Round answers to the nearest hundredth. Gross Earnings(650.95) Allow.(1) Fed. Inc. Tax Social Security (6.2%)Medicare (1.45%) Medical Insurance Pre-tax United Way Total Deductions Net Pay Accum. Gross Earnings ($1,558.90)
For Python: In this assignment you are asked to write a Python program to determine the...
For Python: In this assignment you are asked to write a Python program to determine the Academic Standing of a studentbased on their CGPA. The program should do the following: Prompt the user to enter his name. Prompt the user to enter his major. Prompt the user to enter grades for 3 subjects (A, B, C, D, F). Calculate the CGPA of the student. To calculate CGPA use the formula: CGPA = (quality points * credit hours) / credit hours...
This project involves writing a program to calculate the terms of the following sequence of numbers:...
This project involves writing a program to calculate the terms of the following sequence of numbers: 0 1 1 3 5 11 21 43 … where each term is twice the second previous term plus the previous term. The 0th term of the sequence is 0 and the 1st term of the sequence is 1. The example below shows how to calculate the next sequence term: Current sequence: 0 1 Calculate next term: 2 * 0 + 1 = 1...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT