Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

You are required to implement a basic Java program using Java Standard Edition 8.0 or higher. You are required to modularise classes properly. No method should be longer than 50 lines. You should aim...

1 answer below »
You are required to implement a basic Java program using Java Standard Edition 8.0 or higher.
  • You are required to modularise classes properly. No method should be longer than 50 lines.

  • You should aim to provide high cohesion and low coupling.

  • You should aim for maximum encapsulation and information hiding.

  • Your coding style should be consistent with Java coding conventions

(http://www.oracle.com/technetwork/java/codeconventions XXXXXXXXXXpdf)

  • You should comment important sections of your code remembering that clear and readily comprehensible code is preferable to a comment.

  • Your programs will be marked with Java SE 8.0. Make sure you test your programs with this setting before you make the submission.

You must work out an object design for the above task. You should take advantage of object-oriented concepts such as composition, inheritance, method overriding, abstract classes, interfaces wherever appropriate.


Class hierarchies, relationships and components must be conceptualised in a relevant manner, based on the problem description and special conditions listed in this document. Furthermore, you must be able to explain how your program design will perform in certain scenarios and circumstances.


It may be necessary for your design to provide more functionality, such as accessors and mutators, than is specified in the above sections here for the mechanics of your design to work.

You must submit a zip file of your project .


Answered Same Day Mar 24, 2021 COSC1295

Solution

Pritam answered on Mar 31 2021
132 Votes
import java.util.A
ayList;
import java.util.DateTime;
import java.util.Scanner;
import java.lang.Math;
class RentalRecord
{

declare all member variables
String recordId;
vehicleId_ + customerId_ + rentDate (8 digit format: ddmmyyyy)
DateTime rentDate;
DateTime estimatedReturnDate;
DateTime actualReturnDate;
double rentalFee;
double lateFee;


define accessors
public String getRecordId()             { return recordId; }
public DateTime getRentDate()             { return rentDate; }
public DateTime getEstimatedReturnDate()    { return estimatedReturnDate; }    
public DateTime getActualReturnDate()    { return actualReturnDate; }
public double getRentalFee()            { return rentalFee; }
public double getLateFee()            { return lateFee; }


define mutators
public void setActualReturnDate(DateTime date)
{ actualReturnDate = date; }
public void setRentalFee(double fee)    { rentalFee = fee; }
public void setLateFee(double penalty)    { lateFee = penalty; }


class constructo
RentalRecord(String vehicleId, String customerId, DateTime todayDate, DateTime estDate)
{
        recordId = vehicleId + "_" + customerId + "_" + todayDate.getEightDigitDate();
        rentDate = todayDate;
        estimatedReturnDate = estDate;
}


...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here