Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Module 6 Programming Problem ( starting out with logic and design 4edition) Inst

ID: 3594667 • Letter: M

Question

Module 6 Programming Problem ( starting out with logic and design 4edition)

Instructions

Your success on the Module 6 assignment relies heavily on your ability to skillfully incorporate the concepts presented in Chapter 4 and 5 to those presented in this module. If you have any questions about those chapters you may want to get them answered before you embark on this project.

Use single subscripted array(s) to solve the following problem. A company pays its sales people on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who grosses $3000 in sales in a week receives $200 plus 9% of $3000, or a total of $470. Design a program that determines how many of the salespeople earned salaries in each of the following ranges.

$200-$299

$300-$399

$400-$499

$500-$599

$600-$699

$700-$799

$800-$899

$900-$999

$1000 and over

You will need to declare two arrays, one to hold the salary range and the other to accumulate the count of salespeople in that range.

When you have to check for a range you store either the lowest value in each range in the array and compare the salary to each of those values or you can store the highest value and compare to that. The only change will be the relational operator that you use for your comparison.

Which ever configuration you decide to use should be duplicated in a parallel counter array so that when you determine which range the sales fit into you have the subscript for the counter array already determined.

Your output should list the salary range and the number of salespeople in that range.

Don't forget to include modules in your solution.

Don't forget to include modules in your solution.

Pseudocode can be submitted as a Word, .rft. or .txt file.

Flowcharts may be created in a software program designed for flowcharting. Most will allow you to export or print your solution as a .pdf file that you can upload here. Do not submit a .docx file as Word is not an appropriate software package to create a flowchart or hierarchy chart.

Alternately, flowcharts can be drawn by hand and scanned in for submission as a .pdf file. Drawings that are not legible cannot be graded.

Explanation / Answer

ranges=[200,300,400,500,600,700,800,900,1000]
people=[0,0,0,0,0,0,0,0,0]
n = int(input("Enter the number of people: "))
for i in range(n):
#taking input for each Employee
print("Enter the following details for Employee %d"%(i+1))
salary = int(input("Enter the salary per week: "))
sales = int(input("Enter the sale for week: "))
tot = salary + sales*(9/100.0)
print("%d"%tot)
#checking the salary rangess
for i in range(len(ranges)-1):
if(ranges[i] <= tot <= ranges[i+1]):
print("%d, %d, %d"%(ranges[i] , tot , ranges[i+1]))
people[i] = people[i] + 1
#printing the results
for i in range(len(ranges)-1):
print("%d - %d --> %d"%(ranges[i],ranges[i]+99,people[i]))
print("1000 and above"%people[len(people)])
  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote