Advertisement
akosiraff

Services JAVA

Jan 14th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/services-java/
  3. A local company offers a variety of copying services. Develop a Java™ program to be used by customers to see a listing of possible services, including:
  4. • Soft cover binding, small, $2.50
  5. • Soft cover binding, large, $5.00
  6. • Hard cover binding, small, $6.00
  7. • Hard cover binding, large, $9.00
  8. • Black and white copy, $0.10
  9. • Color copy, $0.25
  10. In order to complete this exercise, you will be required to create a class called Service with the following:
  11. • Service name (String)
  12. • Service price (double)
  13. • A 2-parameter constructor used to initialize the class fields
  14. • Getter and setter methods for each variable
  15. • A toString method used to return a String representation of the service
  16. After completing the Service class, develop a second class to be used as the application driver. This class should contain at least the following:
  17. - A method called main, used to create a set of Service objects to be stored in an array. This method should then allow the user to choose between seeing the services arranged by name or seeing them arranged by price.
  18. - A method called arrangeByName, containing code to sort the services in alphabetical order by service name. Once sorted, the method should display the services to the console.
  19. - A method called arrangeByPrice, containing code to sort the services in order by increasing price. Once sorted, the method should display the services to the console.
  20. Format your output in any way you feel is appropriate. Consider the output from the following sample program:
  21. Welcome to the Kaplan University Copy Center.
  22. Would you like to see our services by name or price (name / price)? name $0.10 Black and white copy
  23. Copyright Kaplan University
  24. Assignment Grading Rubric
  25. Course: IT258 Unit: 9 Points: 120
  26. $0.25
  27. Color copy
  28. $9.00
  29. Hard cover binding, large
  30. $6.00
  31. Hard cover binding, small
  32. $5.00
  33. Soft cover binding, large
  34. $2.50
  35. Soft cover binding, small
  36. Download: http://solutionzip.com/downloads/services-java/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement