Question
Create a new class, in the package rentalcar, named RentalCarUtilsImpl, that has the following 2 methods as described below, write the code for these methods.
Create a new class, in the package rentalcar, named RentalCarUtilsImpl, that has the following 2 methods as described below, write the code for these methods. File format for any input file of a single RentalCar data set is: carVin {space} carYear {space} carMake {end of line} so 1 car per line of input. //receives: inFile, an ALREADY set up Scanner, ready to be read from // precondition: inFile is connected to a Scanner and is not null //returns: a populated RentalCar instance with values of 1 single car // read from the inFile. If values are not there to read, returns null. public static RentalCar readFromScanner(Scanner inFile) { } //receives: outFile an ALREADY set up PrintWriter, ready to be written to // car: a RentalCar instance to write out to outFile // precondition: outFile is connected to a PrintWriter and is not null // car is not null //returns: nothing, prints to the file in same format as input (carVin {space} carYear {space} carMake {end of line} public static void writeToFile(PrintWriter outFile, RentalCar car) { }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started