Jr
Programming
Quiz
Topic: User defined functions
September
19, 2019
Instructions: Using the programming language of C++, write
a program to solve the given problem.
Ensure to include internal documentation.
Create
a salary calculator for a sales company that has ten employees. Each calculation should be completed as an
individual function and called upon in the main function. Calculations for each employee salary includes:
1.
Basic
monthly salary depends on which department the employee is in.
a.
Management
earns $5000.00 per month. There is
only one manager.
b.
Office
Administration earns $2,000.00 per month.
There is only one office administrator.
c.
Sales
earns $1,500.00 per month plus 5% commission on all monthly sales.
2.
A
bonus is paid to all employees if they work on Saturdays. It is optional, so the bonus is $200.00 per Saturday
added to their gross salary.
3.
Employees
earning more than $2,500.00 monthly gross salary pays 25% income tax. Income tax is only on taxable income,
meaning the gross income that is more than $2500.00 monthly.
4.
All
employees pay social security of 10% of gross salary.
5.
Employees
have the option to have one deduction made from salary.
Your
program is to calculate and show the monthly net salary for the employees.
'This algorithm is written by Amirah Kee on Oct-4-2019'
ReplyDeleteLadyville=2.00
Sandhill=3.00
Carmelita=4.00
OrangeWalk=5.00
Print"Kindly enter where you are going:"
Print" (1) if you are going to Ladyville for $2"
Print" (2) if you are going to sandhill for $3"
Print" (3) if you are going to Carmelita for $4"
Print" (4) if you are goiing to Orange Walk for $5"
Input dest
If (dest=1) then
print "Your total cost is $", Ladyville
end if
if (dest=2) then
print "Your total cost is $", Sandhill
end if
if (dest=3) then
print "Your total cost is $", Carmelita
end if
if (dest=4) then
print "Your total cost is $", OrangeWalk
end if
Input Key
'This algorithm is written by Amirah Kee on Oct-4-2019'
ReplyDeleteLadyville=2.00
Sandhill=3.00
Carmelita=4.00
OrangeWalk=5.00
Print"Kindly enter where you are going:"
Print" (1) if you are going to Ladyville for $2"
Print" (2) if you are going to sandhill for $3"
Print" (3) if you are going to Carmelita for $4"
Print" (4) if you are goiing to Orange Walk for $5"
Input dest
If (dest=1) then
print "Your total cost is $", Ladyville
end if
if (dest=2) then
print "Your total cost is $", Sandhill
end if
if (dest=3) then
print "Your total cost is $", Carmelita
end if
if (dest=4) then
print "Your total cost is $", OrangeWalk
end if
Input Key