Question: Hello Guys, I need help putting this program together: I am trying to print a report of all user inputs (combine all print out from

Hello Guys,

I need help putting this program together:

I am trying to print a report of all user inputs (combine all print out from all class) for either animal type dog or monkey, but instead I only get the name, type, gender, age and weight, what am I missing?

RESCUEANIMAL.JAVA

import java.text.SimpleDateFormat;

public class RescueAnimal {

// Instance variables

private String name;

private String type;

private String gender;

private int age;

private float weight;

private SimpleDateFormat acquisitionDate;

private SimpleDateFormat statusDate;

private String acquisitionSource;

private Boolean reserved;

private String trainingLocation;

private SimpleDateFormat trainingStart;

private SimpleDateFormat trainingEnd;

private String trainingStatus;

private String inServiceCountry;

private String inServiceCity;

private String inServiceAgency;

private String inServicePOC;

private String inServiceEmail;

private String inServicePhone;

private String inServicePostalAddress;

// Constructor

public RescueAnimal() {

}

public RescueAnimal(String name, String type, String gender, int age, float weight, SimpleDateFormat acquisitionDate,

SimpleDateFormat statusDate, String inServiceCountry, String inServiceCity, String trainingLocation,

String acquisitionSource, SimpleDateFormat trainingStart, SimpleDateFormat trainingEnd,

String inServiceAgency, String inServicePOC, String inServiceEmail, String inServicePhone, String inServicePostalAddress) {

this.name = name;

this.type = type;

this.gender = gender;

this.age = age;

this.weight = weight;

this.trainingLocation = trainingLocation;

this.trainingStart =trainingStart;

this.trainingEnd = trainingEnd;

this.statusDate = statusDate;

this.acquisitionDate = acquisitionDate;

this.acquisitionSource = acquisitionSource;

this.inServiceCity = inServiceCity;

this.inServiceCountry = inServiceCountry;

this.inServiceAgency = inServiceAgency;

this.inServicePOC = inServicePOC;

this.inServiceEmail = inServiceEmail;

this.inServicePhone = inServicePhone;

this.inServicePostalAddress = inServicePostalAddress;

}

//output Animal Information

public void printInfo() {

System.out.println(name);

System.out.println(type);

System.out.println(gender);

System.out.println(age);

System.out.println(weight);

}

// Add Accessor Methods here

// Add Mutator Methods here

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public String getType() {

return type;

}

public void setType(String type) {

this.type = type;

}

public String getGender() {

return gender;

}

public void setGender(String gender) {

this.gender = gender;

}

public int getAge() {

return age;

}

public void setAge(int age) {

this.age = age;

}

public float getWeight() {

return weight;

}

public void setWeight(float weight) {

this.weight = weight;

}

public SimpleDateFormat getAcquisitionDate() {

return acquisitionDate;

}

public void setAcquisitionDate(SimpleDateFormat aquisitionDate) {

this.acquisitionDate = aquisitionDate;

}

public SimpleDateFormat getStatusDate() {

return statusDate;

}

public void setStatusDate(SimpleDateFormat statusDate) {

this.statusDate = statusDate;

}

public String getAcquisitionSource() {

return acquisitionSource;

}

public void setAcquisitionSource(String acquisitionSource) {

this.acquisitionSource = acquisitionSource;

}

public Boolean getReserved() {

return reserved;

}

public void setReserved(Boolean reserved) {

this.reserved = reserved;

}

public String getTrainingLocation() {

return trainingLocation;

}

public void setTrainingLocation(String trainingLocation) {

this.trainingLocation = trainingLocation;

}

public SimpleDateFormat getTrainingStart() {

return trainingStart;

}

public void setTrainingStart(SimpleDateFormat trainingStart) {

this.trainingStart = trainingStart;

}

public SimpleDateFormat getTrainingEnd() {

return trainingEnd;

}

public void setTrainingEnd(SimpleDateFormat trainingEnd) {

this.trainingEnd = trainingEnd;

}

public String getTrainingStatus() {

return trainingStatus;

}

public void setTrainingStatus(String trainingStatus) {

this.trainingStatus = trainingStatus;

}

public String getInServiceCountry() {

return inServiceCountry;

}

public void setInServiceCountry(String inServiceCountry) {

this.inServiceCountry = inServiceCountry;

}

public String getInServiceCity() {

return inServiceCity;

}

public void setInServiceCity(String inServiceCity) {

this.inServiceCity = inServiceCity;

}

public String getInServiceAgency() {

return inServiceAgency;

}

public void setInServiceAgency(String inServiceAgency) {

this.inServiceAgency = inServiceAgency;

}

public String getInServicePOC() {

return inServicePOC;

}

public void setInServicePOC(String inServicePOC) {

this.inServicePOC = inServicePOC;

}

public String getInServiceEmail() {

return inServiceEmail;

}

public void setInServiceEmail(String inServiceEmail) {

this.inServiceEmail = inServiceEmail;

}

public String getInServicePhone() {

return inServicePhone;

}

public void setInServicePhone(String inServicePhone) {

this.inServicePhone = inServicePhone;

}

public String getInServicePostalAddress() {

return inServicePostalAddress;

}

public void setInServicePostalAddress(String inServicePostalAddress) {

this.inServicePostalAddress = inServicePostalAddress;

}

}

DOG.JAVA

public class Dog extends RescueAnimal {

// Instance variable

public String breed;

// Constructor

public Dog() {

}

// Accessor Method

public String getBreed() {

return breed;

}

// Mutator Method

public void setBreed(String dogBreed) {

breed = dogBreed;

}

}

MONKEY.JAVA

public class Monkey extends RescueAnimal {

//Important Monkey animal types

enum

Species{Capuchin, Guenon, Macaque, Marmoset, SquirrelMonkey, Tamarin;

}

//Variables required for this program

private float tailLength;

private float height;

private float bodyLength;

private float torsoLength;

private float skullLength;

private float neckLength;

private String breed;

//Constructor(s)

public Monkey() {

}

//Accessory Methods

public float getTailLength() {

return tailLength;

}

public float getHeigth() {

return height;

}

public float getBodyLength() {

return bodyLength;

}

public float getTorsoLength() {

return torsoLength;

}

public float getSkullLength() {

return skullLength;

}

public float getNeckLength() {

return neckLength;

}

public String getBreed() {

return breed;

}

//Mutators Methods

public void setTailLength(float apetailLength) {

tailLength = apetailLength;

}

public void setHeight(float apeheight) {

height = apeheight;

}

public void setBodyLength(float apebodyLength) {

bodyLength = apebodyLength;

}

public void setTorsoLength(float apetorsoLength) {

torsoLength = apetorsoLength;

}

public void setSkullLength(float apeskullLength) {

skullLength = apeskullLength;

}

public void setNeckLength(float apeneckLength) {

neckLength = apeneckLength;

}

public void setBreed(String apeBreed) {

breed = apeBreed;

}

}

DRIVER.JAVA-

import java.text.SimpleDateFormat;

import java.util.Scanner;

public class Driver {

public static void main(String[] args) {

// Instance variables

String name;

String type;

String gender;

int age;

float weight;

String acquisitionDate;

String acquisitionSource;

String reserved;

String trainingLocation;

String trainingStart;

String trainingEnd;

String trainingStatus;

String inServiceCountry;

String inServiceCity;

String inServiceAgency;

String inServicePOC;

String inServiceEmail;

String inServicePhone;

String inServicePostalAddress;

Scanner scan = new Scanner(System.in);

// Create New Dog

Dog Haim = new Dog();

Haim.setBreed("Nova Scotia Duck Tolling Retriever");

// Create New Monkey

Monkey Billie = new Monkey();

Billie.setBreed("Squirrel Monkey");

// Method to process request for a rescue animal

System.out.println("Please Enter Animal Information Below");

System.out.println("Please Enter Animal's Name: ");

name = scan.next();

System.out.println("Please Enter Animal's Type: ");

type = scan.next();

System.out.println("Please Enter Animal's Gender: ");

gender = scan.next();

System.out.println("Please Enter Animal's Age: ");

age = scan.nextInt();

System.out.println("Please Enter Animal's Weight: ");

weight = scan.nextFloat();

System.out.println("Please Enter Acquisition Date: ");

acquisitionDate = scan.next();

System.out.println("Please Enter Acquisition Source: (Intake or Farm)");

acquisitionSource = scan.next();

// Method(s) to update information on existing animals

System.out.println("Animal Reserved? (Yes or No): ");

reserved = scan.next();

// Method to display matrix of animals based on location and status/training phase

System.out.println("Please Enter Animal's Training Location: ");

trainingLocation = scan.next();

System.out.println("Please Enter Training Start Date: ");

trainingStart = scan.next();

System.out.println("Please Enter Training End Date: ");

trainingEnd = scan.next();

System.out.println("Please Enter Animal's Training Status: ");

trainingStatus = scan.next();

System.out.println("Please Enter Animal's In-Service Country: ");

inServiceCountry = scan.next();

System.out.println("Please Enter Animal's In-Service City: ");

inServiceCity = scan.next();

System.out.println("Please Enter Animal's In-Service Agency: ");

inServiceAgency = scan.next();

System.out.println("Please Enter Animal's In-Service Point of Contact: ");

inServicePOC = scan.next();

System.out.println("Please Enter In-Service E-mail: ");

inServiceEmail = scan.next();

System.out.println("Please In-Service Phone Number: ");

inServicePhone = scan.next();

System.out.println("Please In-Service Postal Address: ");

inServicePostalAddress = scan.next();

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!