Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will write two classes for program 7. Please submit all classes in one file. The name of the physical program file submitted xxxx_program7. Assignment:

You will write two classes for program 7. Please submit all classes in one file. The name of the physical program file submitted xxxx_program7.

Assignment: A veterinarian services many pets and their owners. As new pets are added to the population of pets being serviced, their information is entered into a flat text file. Each month, the vet requests a listing of all pets. You have to write a program to produce a report of animals and their owners from the data in the flat text file. Below is a description of the information on the text file:

? The first line on the file contains the number of animals on the file (numeric). It can be used to determine the size of the array. Your program should work for any number of Animals.

? The fields below repeat for each animal:

o Owner name (String)

o Birth year (numeric)

o Bill balance (numeric)

o Species (String)

Program requirements and grading:

From the information provided, write a solution that includes the following:

? An Animal class which includes:

o Instance variables (4 points)

o 2 Constructors (10 points)

o Accessor and mutator methods (16 points)

? Write a class xxxx_program7 which utilizes the following:

o An Array of Animal objects (5 points)

o A method which reads the input file provided and stores the objects in the array of Animals. (10 points)

o A method that formats and prints the output report. Please do not use a toString() method but rather call the getters of the Animal class to print the report. (7.5 points)

o The main method will call all the other methods which will: (7.5 points)

? Read the text file and store the objects in the array

? Format and print the report

? Test the program so that there are no errors using the input file provided, program7.txt. Note that the program will only be tested using the file posted on Blackboard. You should not submit another file. (10 points)

? Submit your program in one file, xxxx_program7, where xxxx is your Kean email id. (5 points)

program7.txt

11 Hopper 2003 555 Kangaroo Kitty-1 2009 44 Cat Spotty 2005 333 Dog Johnny 2008 111 Cat Danny 2015 433 Dog Striper 2011 432 Skunk Edward 1995 630 Horse Casper 1998 88 Snake Bootsy 2005 987 Horse Ryanne 2014 21 Fish Jonny 2015 1500 Monkey

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions

Question

What must a creditor do to become a secured party?

Answered: 1 week ago