Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Download: http://solutionzip.com/downloads/services-java/
- 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:
- • Soft cover binding, small, $2.50
- • Soft cover binding, large, $5.00
- • Hard cover binding, small, $6.00
- • Hard cover binding, large, $9.00
- • Black and white copy, $0.10
- • Color copy, $0.25
- In order to complete this exercise, you will be required to create a class called Service with the following:
- • Service name (String)
- • Service price (double)
- • A 2-parameter constructor used to initialize the class fields
- • Getter and setter methods for each variable
- • A toString method used to return a String representation of the service
- After completing the Service class, develop a second class to be used as the application driver. This class should contain at least the following:
- - 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.
- - 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.
- - 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.
- Format your output in any way you feel is appropriate. Consider the output from the following sample program:
- Welcome to the Kaplan University Copy Center.
- Would you like to see our services by name or price (name / price)? name $0.10 Black and white copy
- Copyright Kaplan University
- Assignment Grading Rubric
- Course: IT258 Unit: 9 Points: 120
- $0.25
- Color copy
- $9.00
- Hard cover binding, large
- $6.00
- Hard cover binding, small
- $5.00
- Soft cover binding, large
- $2.50
- Soft cover binding, small
- Download: http://solutionzip.com/downloads/services-java/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement