Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The purpose of this project is to give students more exposure to object oriented

ID: 3828010 • Letter: T

Question

The purpose of this project is to give students more exposure to object oriented design and programming using classes and polymorphism in a realistic application that involves arrays of objects and sorting arrays containing objects. A large 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 and updates listing of all pets sorted by their "outstanding bill balance". You are to write a program which will produce a report of animals and their owners sorted by their outstanding balances from the data in the flat text file. Program requirements and grading: A class named Animal with the following details/subclasses (1) Name (owner) a character string birth year numeric bill balance numeric a character string species Special specie feature Mammal legs or nonMammal blood type Constructor method(s) of all classes Accessor and mutator methods of all classes An array of Animal objects Read an input text file from http://imc.kean.edu/CPS2231/program5.txt with the ordering as above, one grouping for each animal will be provided. Also, the first item in the file is the number of animals. You should test your program with the input data. One method for inputting each Animal object. One method for producing an output report - formatting is one Animal per line and at most 40 Animals per page. One method for sorting the array of Animals. One "simple main" method that: 1) calls for all input, 2) calls a sort method, and 3) calls for the report of the sorted list. Record your planning time, coding time, testing time and bug fixing time. Put these information in the comments at the top of the program. Design thoughts: The use of methods and subclasses is very beneficial as programs become larger and their logic becomes more difficult In fact, different industries/companies have their own software development requirements (standards) to improve readability, testability, maintainability and overall design. It is up to you to logically dissect the problem and determine the subclasses and methods you will be using in your design. I suggest that you use the Animal class as a super class and create new subclasses. How to submit: Please name the Java Class as XXXX_Program5 and file name as XXXX_Program5.java where XXXX is your Kean email ID. Please submit the program online at http://imc.kean.edu/students/

Explanation / Answer

/** * @fileName Animal.java * @author ravi * @since 29/4/17 */ package XXXX_Program5; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; public class XXXX_Program5 { public static void main(String[] args) throws FileNotFoundException { Animal [] animals; Scanner sc = new Scanner(new File("")); int size = Integer.parseInt(sc.nextLine()); } } class Animal { String ownerName; int birthYear; int billBalance; String species; public Animal(String ownerName, int birthYear, int billBalance, String species) { this.ownerName = ownerName; this.birthYear = birthYear; this.billBalance = billBalance; this.species = species; } public Animal() { } public String getOwnerName() { return ownerName; } public void setOwnerName(String ownerName) { this.ownerName = ownerName; } public int getBirthYear() { return birthYear; } public void setBirthYear(int birthYear) { this.birthYear = birthYear; } public int getBillBalance() { return billBalance; } public void setBillBalance(int billBalance) { this.billBalance = billBalance; } public String getSpecies() { return species; } public void setSpecies(String species) { this.species = species; } } class Features extends Animal{ int numberOfLegs; String bloodType; public Features(String ownerName, int birthYear, int billBalance, String species) { super(ownerName, birthYear, billBalance, species); } public Features(int numberOfLegs) { this.numberOfLegs = numberOfLegs; } public void setNumberOfLegs(int numberOfLegs) { this.numberOfLegs = numberOfLegs; } public void setBloodType(String bloodType) { this.bloodType = bloodType; } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote