COSC120 Project # 1 Salary Calculation Program

$30.00

Category: Tags: , , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (4 votes)

Project Specification
Write a program to calculate the salary paid to its salespersons at Pohanka. The salary is calculated
based on a salesperson’s length of employment in years and employment category (full-time employee
or part-time employee). The salary calculation rules are as following:
1) If an employee is a part-time employee and worked here for less than 5 years, the salary consists
of only the commission amount;
2) If an employee is a part-time employee and worked here for more than or equal to 5 years, the
salary consists of base salary of $2,500 and commission amount;
3) If an employee is a full-time employee and worked here for less than 5 years, the salary consists
of base salary of $5,000 and commission amount;
4) If an employee is a full-time employee and worked here for more than or equal to 5 years, the
salary consists of base salary of $10,000 and commission amount.
The commission amount is calculated using the following commission rates:
Sales Amount Commission Rate
$0 to $15,000 10%
$15,001 to $60,000 15%
Over $60,000 33%
But there is a catch. The sales amount between $15,001 to $60,000 gets only 10% on the first $15,000
and 15% on the remaining. The sales amount above $60,000 pays only 10% on the first $15,000 and
15% on the next $45,000 and 33% on the remaining amount.
Program Requirements
Your program will receive a user’s input of the number of salespersons from the keyboard. For each
salesperson, your program will 1) read in the salesperson’s first name, last name, the length of
employment in years, employment category, and the sale amount in dollar from the keyboard; 2)
calculate the appropriate commission and salary for this salesperson; 3) display this salesperson’s first
name, last name, total commission, and total salary amount in a nice format. Before your program exits,
it should display the average commission and the average salary amount for all the employees.
This Project Consists of Three Parts
1) (10%) Design the algorithm, which must include the following:
a. Use a few sentences to give a brief description of the problem given above.
b. Identify the nouns and verbs used in the above project descriptions.
c. Among the above identified nouns, list the ones that are necessary to define variables in your
program. For each variable, specify its name, data type, and what information it is used to store.
d. Write the pseudo code algorithm (i.e. algorithm steps) to solve this problem.
2
2) (60%) C++ code
a. For the base salaries and commission rates, you should not use literals in your code. Use constants
instead to keep these values.
b. YOU MUST COMMENT YOUR CODE.
c. You should give meaningful variable names;
d. You need to conduct the following error checking of user input:
– length of employment must NOT be less than or equal to 0;
– sales amount must NOT be less than or equal to 0.
3) (30%) Testing
a. Create your testing plan
b. Follow your testing plan to thoroughly test all possible cases, which include all commission rates,
lengths of employment, and employment categories. Make sure to test your error checking code.
Keep all your testing data and testing results so you can submit them.
What to hand in
You will upload a PDF document via myClasses. Your PDF document should include the
following:
a. Use a few sentences to give a brief description of the problem.
b. Identify the nouns and verbs used in the above project descriptions.
c. Among the above identified nouns, list the ones that are necessary to define variables in your
program. For each variable, specify its name, data type, and what information it is used to store.
d. Write the pseudo code algorithm (i.e. algorithm steps) to solve this problem.
e. Your C++ Source Code.
f. Your testing plan.
g. All output of your program generated during testing.
h. Write down WHAT help you got from WHO when you worked on this project.