akosiraff

Download Discount

Dec 4th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1.  
  2. Download: https://solutionzip.com/downloads/discount/
  3. You have been contracted to create an application that can be used to determine the discount awarded for preferred customers. Because of the time limitation, you should focus your attention on the preferred customer class. Include data members of customer ID, customer name, and customer purchase. Define appropriate constructors and properties for the class.
  4. Include a method that returns the discount percentage based on the following:
  5. • When a preferred customer spends a minimum of $500, he or she gets a 5 percent discount
  6. • When a preferred customer spends a minimum of $1,000, his discount is 6 percent
  7. • When a preferred customer spends a minimum of $1,500, his discount is 7 percent discount
  8. • When a preferred customer spends at least $2,000, he or she gets a 10 percent discount
  9. Include an additional instance method that returns the actual reduced discounted price. Override the ToString( ) method to return the customer name, his purchase amount (formatted as currency), discount percentage (if any),and the reduced purchase price (formatted as currency).
  10. Define the 2nd class to test your preferred customer class. You may instantiate your objects with literal data sent as arguments to the constructors. You do not have to input the data. USE YOUR OWN NAME AS THE CUSTOMER NAME FOR ONE OF THE OBJECTS THAT YOU INSTANTIATE. Before instantiating an object of the class, check to make sure the purchase amount entered is a positive integer. If the value entered for the purchase amount is negative, display an error message indicating the input is in-valid. Modularize your solution.
  11. Sample output might look like:
  12. Test1:
  13. Customer: Barbara Doyle
  14. Purchase Amt. $1,423.78
  15. Discount Percent: 6%
  16. Discounted Amt.: $1,338.36
  17. Test2:
  18. Customer: Sarah Wang
  19. Purchase Amt. $401.28
  20. Discount Percent: 0%
  21. Discounted Amt.: $401.28
  22. Download: https://solutionzip.com/downloads/discount/
Add Comment
Please, Sign In to add comment