Question: JAVA NEEDED Purpose: To practice writing a class that uses aggregation and that has an array as a field. To read data from a text
JAVA NEEDED Purpose: To practice writing a class that uses aggregation and that has an array as a field. To read data from a text file. Write the class files and a sample Driver class to test the code for the following: You are writing code for a veterinary office. Each human client will have: A last name A first name An address A client ID number of visits Outstanding Balance an array of Pets (aggregation) Each Pet will have: A name An animal type A weight A date of last rabies shot (String) A date of last visit (String) Write the constructor methods and toString ( ) method for each class. The toString( ) of the Client class must concatenate the values of each Pet in the array: name and type. Write an equals( ) method for the client based on the client id. Write a program that reads in data from a file to create and array of five Clients. The driver will print each clients information (along with the pet name and type)
File structure: Last name, first name, address, ID, number of visits, balance, number of pets Pet name, animal type, weight, rabies date, last visit date
Then, in the driver, present a menu to the user with the following repeating options: Search for a client by ID number, if ID is found, a) print the client name and outstanding balance b) print the list of the clients pets, name, type and date of last visit c) change the clients outstanding balance d) quit nb: You do not have to change the underlying file, but it would be a good thing to try that. ------petclienttxt-------
Morely,Robert,123 Anywhere Street,15396,4,234.56,2 Bubba,Bulldog,58,4-15-2010,6-14-2011 Lucy,Bulldog,49,4-15-2010,6-14-2011 Wilder,John,457 Somewhere Road,78214,3,124.53,1 Ralph,Cat,12,01-16-2011,04-21-2012 Miller,John,639 Green Glenn Drive,96258,5,0.00,3 Major,Lab,105,07-10-2012,06-13-2013 King,Collie,58,06-14-2012,10-05-2012 Pippy,cat,10,04-25-2012,04-25-2012 Jones,Sam,34 Franklin Apt B,47196,1,32.09,1 Gunther,Swiss Mountain Dog,125,10-10-2013,10-10-2013 Smith,Jack,935 Garrison Blvd,67125,4,364.00,4 Perry,Parrot,5,NA,3-13-2014 Jake,German Shepherd,86,11-14-2013,11-14-2013 Sweetie,tabby cat,15,12-15-2013,2-15-2014 Pete,boa,8,NA,3-15-2014
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
