The application should ask the user to enter annual sales, and it should display the total annual compensation.
All things are lawful, but not all things are profitable.
All things are lawful, but not all things are profitable.
There is probably another problem there, caused largely by your inconsistent indentation. Please go back and indent your code properly with the right line lengths. More details here. You may have created those classes as inner classes unintentionally because you have all the { and } in the wrong places. People think we are being fussy going on about indentation, but experience shows that wrong indentation can introduce errors into your code, and also makes those errors much more difficult to find.Knute Snortum wrote:. . . you have two classes, the first with several inner classes and main() methods. This is a problem. . . .
All things are lawful, but not all things are profitable.
jeff cantrell wrote:so your saying it should look something like this not have the public before the classes only in front of the commissioncalculation1 and then the rest should just be class and the name of the class correct
I wrote: you could create a whole bunch of PayCalculator objects and have them each take care of all calculations related to whatever annual sales amount you give each of them. Then you could go around and tell each object in turn, "Please show the total compensation that you calculated for the annual sales amount that I gave you earlier." That's another requirement, right?
jeff cantrell wrote:Your right I did make that mistake I changed it just now wow.
But a lot of object‑oriented programming does behave like the real world. You ask real world salespeople how much they have sold and you pay real world salespeople a salary.Junilu Lacar wrote:. . . Object-Oriented Programming and thinking in terms of objects is not necessarily about modeling the real world in your program. . . .
Campbell Ritchie wrote:
But a lot of object‑oriented programming does behave like the real world. You ask real world salespeople how much they have sold and you pay real world salespeople a salary.Junilu Lacar wrote:. . . Object-Oriented Programming and thinking in terms of objects is not necessarily about modeling the real world in your program. . . .
Campbell Ritchie wrote:You ask real world salespeople how much they have sold and you pay real world salespeople a salary.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |