Assume a salesperson is paid a variable-rate commission depending on the number of sales made for the week. The quota is 30 sales.
If the persons individually make fewer than 10 sales, they are paid $50/sale. If they make 10 to 30 sales, they are paid $100/sale. If they exceed the quota, they are paid $150/sale. If they make fewer than 5 sales or more than 60 sales, it is considered to be an input error and no commission is paid.
Write a program to input a salesperson’s name and number of sales made. Write a function that will calculate the commission. The function should accept number of sales and return amount of commission.