Question: Java : 1. Write a program that allows you to write and read records of type PetRecord (available on the K: drive) to a file.
1. Write a program that allows you to write and read records of type PetRecord (available on the K: drive) to a file. The program asks the user to choose between reading and writing from a file. In either case, the program next asks for the file name. If the user asked to write to a file, they can enter as many records as desired. If the user asked to read from a file, they are shown all of the records in the file. Be sure that the records do not scroll by so quickly that the user cannot read them. Redefine the class PetRecord so that it is serializable. 2. Write a program that reads records of type PetRecord from the file created in step 1 and outputs the following information to the screen: the name and weight of the largest pet, the name and weight of the smallest pet, the name and age of the youngest pet, and the name and age of the oldest pet. Could there be pets with the same name, weight and age
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
