Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help with this problem Develop car rental application may use to produce a receipt. A receipt se to produce a receipt. A receipt will

need help with this problem image text in transcribed
image text in transcribed
Develop car rental application may use to produce a receipt. A receipt se to produce a receipt. A receipt will be formatted as follows: EZ - RIDER Rental Receipt Customer : John Jones Driver License: PA 12343 Telephone : 724-555-8345 Credit Card : VISA 12345678012 Vehicle : Mercedes 350E Tag : : PA 342399 Rent Class Luxury Sedan Daily Rate : $ 95.00 Weekly Rate : $ 545.00 Date/Time Out Date/Time In Rental Charge Airport Tax Sales Tax Total 01/10/2017 at 10:45 : 01/20/2017 at 11:44 : $ 830.00 $ 150.00 : $ 49.80 : $ 1029.80 For this application create four main classes for customer, rental class, vehicle, and rental agreement. The customer class should have six pieces of information (i.e. instance variables) including customer name (as a String), driver's license state (as a String), driver's license number (as an int), telephone number (as a String), credit card type (as a String), and credit card number (as a long). A rental class represents the rental terms for a class of vehicle. For example Compact, Mid-Size, Full Size, Sport etc. are classifications of cars with each time having different rental terms. A rental class should have three pieces of information: a rental class name (as a String), a daily rate (as a double) and a weekly rate (as a double). A vehicle should have four pieces of information: a make/model (as a String), state issuing a tag (as a String), a tag number (as a String) and a rental class (as a rental class). Lastly a rental agreement is the agreement of a customer to rental a given vehicle together with the rental terms, date/time out and date/time in. Thus a rental agreement has 4 pieces of information: the customer, the vehicle, date/time out (as a LocalDate Time) and date/time in. For your customer class, provide a constructor accepting values for all instance variables. Provide getter methods for all instance variables, but setter methods for only the telephone, credit card type and credit card number variables. For rental class class, provide a constructor accepting values for all instance variable, Provide getter methods for all instance variables. Likewise for the vehicle class. For your rental agreement class provide a constructor accepting values for all instance variables except date/time in as it is intended that this field will be given a value only when the customer returns the vehicle. Provide only getter methods for all instance variables. Provide a setter method for only the date/time in variable. To represent a date/time use Java's LocalDate Time class. For this class, however, do not use new to create instances. Instead use the static method of: LocalDateTime dateTimeOut = LocalDateTime.of(2017, 1, 10, 8, 45); The above example creates a LocalDate Time for 1/10/2017 at 8:45. In the rental agreement provide getRentalCharge(), getAirport Tax(), getSales Tax and get Total() methods. The getRentalCharge() is to return the number of days rented times the daily rental rate. The getAirport Tax() is to return the number of days rented times $ 15.00. The getTax() is to return the rental change times 6%. The getTotal() is to return the sum of rental charge, airport tax, and tax. In addition to the special get methods, provide a print receipt method that will print the receipt according to the above format. A day is a 24 hours period. However, there is a one hour grace in returning a car. That is if a car is returned after 24 hours and 59 minutes, then only one day is used in the computations, 25 hours is two days. To compute the number of days between dateTimeOut and date Timeln, use the following code: int noDays - Duration between(dateTimeOut, dateTimeIn).plusMinutes (23 * 60). toDays()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions