Campbell Ritchie wrote:Welcome to the Ranch
![]()
I would have thought you can guess how to apply a discount, but I suggest you start by writing down on paper what you want your app to do. That will probably concentrate your thinking.
Why did you ask about the strategy pattern? You don't seem to mention it in the body of your post.
William Ng wrote:Who is teaching you? This is not proper OO programming! You should really be creating more classes to handle the problem, not just using the main class, and some language defined classes. If done in proper OO fashion, this should be pretty trivial. Are you really sure this is how the Prof wants it?
|
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
|