week 13 and 14

Week 13

i)

In Chapter 11, you created an interactive RentalDemo class that obtains all the data for four rentals from Sammy’s Seashore Rentals, including details about the contract number, length of the rental, and equipment type. Now, modify the class so that it becomes immune to user data entry errors by handling exceptions for each numeric entry. Each time the program requires numeric data—for example, for the rental period—continuously prompt the user until the data entered is the correct type. Save the revised program as RentalDemo.java.

Create a zip file of the .java file(s) and submit the assignment.

ii) a. In Chapter 12, you created an interactive RentalDemo class that obtains all the data for four rentals from Sammy’s Seashore Rentals, including details about the contract number, length of the rental, and equipment type. Now, modify the program to create a data file that contains each contract number, rental time in hours and minutes, equipment type code and name, and price. Save the program as RentalDemoAndCreateFile.java.

b. Write a program that displays the data saved in the file created in part 2a. Save the program as DisplayRentalFile.java.

Create a zip file of the .java file(s) and submit the assignment.

Week 14

i)

In previous chapters, you have created a number of programs for Carly’s Catering. Now, create an interactive GUI program that allows the user to enter the number of guests for an event into a text field; if the value entered is not numeric, set the event price to 0. Also allow the user to choose one entree from a group of at least four choices, up to two side dishes from a group of at least four choices, and one dessert from a group of at least three choices. Display the cost of the event as $35 per person; as the user continues to make selection changes, display a list of the current items chosen. If a user attempts to choose more than two side dishes, remove all the current side dish selections so that the user can start over. Save the program as JCarlysCatering.java.

Create a zip file of the .java file(s) and submit the assignment.

ii)

. In previous chapters, you have created a number of programs for Sammy’s Seashore Rentals. Now, create an interactive GUI program that allows the user to enter a rental time in hours into a text field; if the value entered is not numeric, set the rental price to 0. Also allow the user to choose one equipment type to rent from a group of seven choices. The rental fee is $40 per hour for a personal watercraft or pontoon boat; $20 per hour for a rowboat, canoe, or kayak; and $7 per hour for a beach chair or umbrella. Let the user add an equipment lesson for an extra $5. Display a message that indicates all the details for the rental, including the total price. Save the program as JSammysSeashore.java.

Create a zip file of the .java file(s) and submit the assignment.