(what the output is suppose to look like in pictures with all the animals ) (you don't have to write every animal like example I need help structuring the codes maybe 2 or four of each animal type but not all of them) in java A MyPetStore sells many pets and their accessories. As new pets are added to the MyPetStore, their information is entered into a flat text file. Each month, the manager requests a listing of all pets sorted by their price. You must write a program to produce a report of MyPetStore and their types sorted by their prices from the data in the flat text file. Below is a description of the information on the text file: • The first entry is the number of animals on the file (numeric) • The fields below repeat for each animal: o Pet name (String) o Birthdate (java.time.LocalDate) o Price (numeric) o Species Type (String) o Special feature (boolean or String) The animals sold by the MyPetStore are of six types: Dogs & Cats, Reptiles, Birds, Rabbits & Small Animals. For Dogs & Cats, the special feature field on the flat file is the breed of the animal (String). For Reptiles, the special feature field is the blood type (warm vs cold-blooded, String). For Birds, the special feature field is the movement type (flies or walks, String) For Rabbits & Small Animals, the special feature field is itBites: yes or no (boolean). Program requirements and grading: From the information provided, write a solution that includes the following: A suitable inheritance hierarchy that represents the pets sold by the MyPetStore. It is up to you how to design the inheritance hierarchy. We suggest a Pet class and appropriate subclasses. For all classes include the following: Instance variables Constructors Accessor and mutator methods Suitable toString() methods Write a class xxxx_program which utilizes the following: An Array of Pet objects A method which reads the input file provided and stores the objects in the array of Pets. A method which sorts the array of Pets in ascending order by the price. A method that formats and prints the output report on the Java console. There should be report headers, one Pet per line and at most 40 Pets per page, the main method will call all the other methods which will: Read the text file and store the objects in the array. Sort the objects. Format and print the report. Test the program so that there are no errors using the input file provided, input.csv. Note that the program will only be tested using the file posted on Canvas. You should not submit another file. Record your planning time, coding time, testing time and bug fixing time. import java.io.File; import java.io.IOException; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.InputMismatchException; import java.util.Scanner; // Required Classes: class Pet { } class DogOrCat extends Pet { } class Reptile extends Pet { } class Bird extends Pet { } class RabbitOrSmallAnimal extends Pet { } // public class xxxx_program, you main method is in here public class xxxx_program { static Pet [] petArr = new Pet[140]; public static void main(String[] args) throws Exception { arrayPets(); sort(petArr); printArray(petArr); } //Creates an array of pets from the file public static void arrayPets() throws IOException, InputMismatchException { } //Sorts the array public static void sort(Pet[] petArr) { } //Prints the array public static void printArray(Pet[] petArr) { } }
information is entered into a flat text file. Each month, the manager requests a listing of all pets sorted by
their price. You must write a program to produce a report of MyPetStore and their types sorted by their prices
from the data in the flat text file. Below is a description of the information on the text file:
• The first entry is the number of animals on the file (numeric) •
The fields below repeat for each animal:
o Pet name (String)
o Birthdate (java.time.LocalDate)
o Price (numeric)
o Species Type (String)
o Special feature (boolean or String)
The animals sold by the MyPetStore are of six types: Dogs & Cats, Reptiles, Birds, Rabbits & Small
Animals.
For Dogs & Cats, the special feature field on the flat file is the breed of the animal (String).
For Reptiles, the special feature field is the blood type (warm vs cold-blooded, String).
For Birds, the special feature field is the movement type (flies or walks, String)
For Rabbits & Small Animals, the special feature field is itBites: yes or no (boolean).
Program requirements and grading:
From the information provided, write a solution that includes the following:
A suitable inheritance hierarchy that represents the pets sold by the MyPetStore. It is up to
you how to design the inheritance hierarchy. We suggest a Pet class and appropriate
subclasses.
For all classes include the following:
Instance variables
Constructors
Accessor and mutator methods
Suitable toString() methods
Write a class xxxx_program which utilizes the following:
An Array of Pet objects
A method which reads the input file provided and stores the objects in the array of Pets.
A method which sorts the array of Pets in ascending order by the price.
A method that formats and prints the output report on the Java console. There should be
report headers, one Pet per line and at most 40 Pets per page,
Sort the objects.
Format and print the report.
Test the program so that there are no errors using the input file provided, input.csv. Note that the
program will only be tested using the file posted on Canvas. You should not submit another file.
Record your planning time, coding time, testing time and bug fixing time.
import java.io.File;
import java.io.IOException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.InputMismatchException;
import java.util.Scanner;
// Required Classes:
class Pet {
}
class DogOrCat extends Pet {
}
class Reptile extends Pet {
}
class Bird extends Pet {
}
class RabbitOrSmallAnimal extends Pet {
}
// public class xxxx_program, you main method is in here
public class xxxx_program {
static Pet [] petArr = new Pet[140];
public static void main(String[] args) throws Exception {
arrayPets();
sort(petArr);
printArray(petArr);
}
//Creates an array of pets from the file
public static void arrayPets() throws IOException, InputMismatchException {
}
//Sorts the array
public static void sort(Pet[] petArr) {
}
//Prints the array
public static void printArray(Pet[] petArr) {
}
}



Trending now
This is a popular solution!
Step by step
Solved in 7 steps with 3 images









