Computer JAVA

profileDipeshb
RentalCarTransaction.java

/****************************** COSC-1436 El Centro College Professor Keith Smelser Rental Car Transaction Class TODO Student Name: Student ID: */ import java.time.LocalDate; public class RentalCarTransaction { // This is the Composition of object items Automobile carToRent = new Automobile(); FormOfPayment paymentInfo = new FormOfPayment(); USA_Address PickupLocation = new USA_Address(); USA_Address DropOffLocation = new USA_Address(); LocalDate StartDate = LocalDate.now(); LocalDate EndDate = LocalDate.now(); int StartMileage = -1; int EndMileage = -1; /* (non-Javadoc) * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("RentalCarTransaction [\n carToRent="); builder.append(carToRent); builder.append(",\n paymentInfo="); builder.append(paymentInfo); builder.append(",\n PickupLocation="); builder.append(PickupLocation); builder.append(",\n DropOffLocation="); builder.append(DropOffLocation); builder.append(",\n StartDate="); builder.append(StartDate); builder.append(",\n EndDate="); builder.append(EndDate); builder.append(",\n StartMileage="); builder.append(StartMileage); builder.append(",\n EndMileage="); builder.append(EndMileage); builder.append("]"); return builder.toString(); } public static void main(String[] args) { RentalCarTransaction myRentalCar = new RentalCarTransaction(); myRentalCar.carToRent.setAutoManufacturer("Chevy"); // TODO example - Change to your preference //TODO load all data here // Show final results System.out.println(myRentalCar); } }