Posted by Anonymous on Friday, September 23, 2011 at 7:54am.
There can be many ways to approach the problem, but it would be obvious that you'll need to create a class.
The instance variables will contain the employee's name, and the weekly sales.
The constants (7%, 18%, 10%, 6%, etc.) could be a static constant, since every employee uses the same values. By setting it as a static constant, you will avoid multiple copies when new instances are created, also it is easier to edit if these rates change.
A mutator is a method that modifies the value of an instance variable, say the weekly sales.
An accessor is method that returns the value of a given instance variable.
In general, you would have a method for data entry for the employee, and all data would be written through the constructor. Instance variables should be private, so any access should be done through an accessor.
You'd have another method to print the calculations or the "pay slip", whichever way you prefer.
If you come up with a pseudocode, feel free to post it for comments. However, we do not do the work for you, for the reason that solving the problem is a cognitive process that helps you learn and retain what you learned, which you'll need for exams and more important, when you eventually get a job in the field.
Related Questions
programming - A small startup software developer company needs to create a ...
computers - I have just started a basic class in programming and I am totally ...
computer science - Step 3: Part C iLab Part C: Payroll Program Step 1: Create a ...
event driven programming - 8. Write a visual basic program that accepts basic ...
computer Programming - A small startup software developer company needs to ...
programming - I am having trouble writing this program for java. can anybody ...
Programming with Eclipse - Design, implement, test, and debug an application to ...
computer programming - small startup software developer company needs to create ...
computer - A small startup software developer company needs to create a program ...
CIS115 - A small startup software developer company needs to create a program ...
For Further Reading