I have completed a large portion of this work... but I don't know if it is good enough. Please look it over and give me any advice, tips, critiques, etc. I think I may need more constructors.
Here are the directions to this portion:
Here is the code so far:
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: initialize objects
public RescueAnimal() {
}
// Add Accessor Methods here: aka "getters"
public String getName() {
return name;
}
public String getType() {
return type;
}
public String getGender() {
return gender;
}
public int getAge() {
return age;
}
public float getWeight() {
return weight;
}
public SimpleDateFormat getAcquisitionDate() {
return acquisitionDate;
}
public SimpleDateFormat getStatusDate() {
return statusDate;
}
public String getAcquisitionSource() {
return acquisitionSource;
}
public Boolean getReserved() {
return reserved;
}
public String getTrainingLocation() {
return trainingLocation;
}
public SimpleDateFormat getTrainingStart() {
return trainingStart;
}
public SimpleDateFormat getTrainingEnd() {
return trainingEnd;
}
public String getTrainingStatus() {
return trainingStatus;
}
public String getInServiceCountry() {
return inServiceCountry;
}
public String getInServiceCity() {
return inServiceCity;
}
public String getInServiceAgency() {
return inServiceAgency;
}
public String getInServicPOC() {
return inServicPOC;
}
public String getInServiceEmail() {
return inServiceEmail;
}
public String getInServicePhone() {
return inServicePhone;
}
public String getInServicePostalAddress() {
return
inServicePostalAddress;
}
// Add Mutator Methods here: aka "modifiers"
public void setName(String name) {
this.name = name;
}
public void setType(String type) {
this.type = type;
}
public void setGender(String gender) {
this.gender = gender;
}
public void setAge(int age) {
this.age = age;
}
public void setWeight(float weight) {
this.weight = weight;
}
public void setAcquisitionDate(SimpleDateFormat
acquisitionDate) {
this.acquisitionDate =
acquisitionDate;
}
public void setStatusDate(SimpleDateFormat statusDate)
{
this.statusDate = statusDate;
}
public void setAcquisitionSource(String
acquisitionSource) {
this.acquisitionSource =
acquisitionSource;
}
public void setReserved(Boolean reserved) {
this.reserved = reserved;
}
public void setTrainingLocation(String
trainingLocation) {
this.trainingLocation =
trainingLocation;
}
public void setTrainingStart(SimpleDataFormat
trainingStart) {
this.trainingStart =
trainingStart;
}
public void setTrainingEnd(SimpleDateFormat
trainingEnd) {
this.trainingEnd =
trainingEnd;
}
public void setTrainingStatus(String trainingStatus)
{
this.trainingStatus =
trainingStatus;
}
public void setInServiceCountry(String
inServiceCountry) {
this.inServiceCountry =
inServiceCountry;
}
public void setInServiceCity(String inServiceCity)
{
this.inServiceCity =
inServiceCity;
}
public void setInServiceAgency(String inServiceAgency)
{
this.inServiceAgency =
inServiceAgency;
}
public void setInServicePOC(String nServicePOC)
{
this.inServicePOC =
inServicePOC;
}
public void setInServiceEmail(String inServiceEmail)
{
this.inServiceEmail =
inServiceEmail;
}
public void setInServicePhone(String inServicePhone)
{
this.inServicePhone =
inServicePhone;
}
public void setInServicePostalAddress(String
inServicePostalAddress) {
this.inServicePostalAddress =
inServicePostalAddress;
}
}
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: initialize objects
public RescueAnimal() {
}
// Parametrised constructor to initialize all the fields
public RescueAnimal(String name, String type, String gender, int age, float weight, SimpleDateFormat
acquisitionDate, SimpleDateFormat statusDate, String acquisitionSource, Boolean reserved, String
trainingLocation, SimpleDateFormat trainingStart, SimpleDateFormat trainingEnd, String trainingStatus,
String inServiceCountry, String inServiceCity, 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.acquisitionDate = acquisitionDate;
this.statusDate = statusDate;
this.acquisitionSource = acquisitionSource;
this.reserved = reserved;
this.trainingLocation = trainingLocation;
this.trainingStart = trainingStart;
this.trainingEnd = trainingEnd;
this.trainingStatus = trainingStatus;
this.inServiceCountry = inServiceCountry;
this.inServiceCity = inServiceCity;
this.inServiceAgency = inServiceAgency;
this.inServicePOC = inServicePOC;
this.inServiceEmail = inServiceEmail;
this.inServicePhone = inServicePhone;
this.inServicePostalAddress = inServicePostalAddress;
}
// Add Accessor Methods here: aka "getters"
public String getName() {
return name;
}
public String getType() {
return type;
}
public String getGender() {
return gender;
}
public int getAge() {
return age;
}
public float getWeight() {
return weight;
}
public SimpleDateFormat getAcquisitionDate() {
return acquisitionDate;
}
public SimpleDateFormat getStatusDate() {
return statusDate;
}
public String getAcquisitionSource() {
return acquisitionSource;
}
public Boolean getReserved() {
return reserved;
}
public String getTrainingLocation() {
return trainingLocation;
}
public SimpleDateFormat getTrainingStart() {
return trainingStart;
}
public SimpleDateFormat getTrainingEnd() {
return trainingEnd;
}
public String getTrainingStatus() {
return trainingStatus;
}
public String getInServiceCountry() {
return inServiceCountry;
}
public String getInServiceCity() {
return inServiceCity;
}
public String getInServiceAgency() {
return inServiceAgency;
}
public String getInServicPOC() {
return inServicPOC;
}
public String getInServiceEmail() {
return inServiceEmail;
}
public String getInServicePhone() {
return inServicePhone;
}
public String getInServicePostalAddress() {
return inServicePostalAddress;
}
// Add Mutator Methods here: aka "modifiers"
public void setName(String name) {
this.name = name;
}
public void setType(String type) {
this.type = type;
}
public void setGender(String gender) {
this.gender = gender;
}
public void setAge(int age) {
this.age = age;
}
public void setWeight(float weight) {
this.weight = weight;
}
public void setAcquisitionDate(SimpleDateFormat acquisitionDate) {
this.acquisitionDate = acquisitionDate;
}
public void setStatusDate(SimpleDateFormat statusDate) {
this.statusDate = statusDate;
}
public void setAcquisitionSource(String acquisitionSource) {
this.acquisitionSource = acquisitionSource;
}
public void setReserved(Boolean reserved) {
this.reserved = reserved;
}
public void setTrainingLocation(String trainingLocation) {
this.trainingLocation = trainingLocation;
}
public void setTrainingStart(SimpleDataFormat trainingStart) {
this.trainingStart = trainingStart;
}
public void setTrainingEnd(SimpleDateFormat trainingEnd) {
this.trainingEnd = trainingEnd;
}
public void setTrainingStatus(String trainingStatus) {
this.trainingStatus = trainingStatus;
}
public void setInServiceCountry(String inServiceCountry) {
this.inServiceCountry = inServiceCountry;
}
public void setInServiceCity(String inServiceCity) {
this.inServiceCity = inServiceCity;
}
public void setInServiceAgency(String inServiceAgency) {
this.inServiceAgency = inServiceAgency;
}
public void setInServicePOC(String nServicePOC) {
this.inServicePOC = inServicePOC;
}
public void setInServiceEmail(String inServiceEmail) {
this.inServiceEmail = inServiceEmail;
}
public void setInServicePhone(String inServicePhone) {
this.inServicePhone = inServicePhone;
}
public void setInServicePostalAddress(String inServicePostalAddress) {
this.inServicePostalAddress = inServicePostalAddress;
}
}
I have completed a large portion of this work... but I don't know if it is...
I have done a decent amount of coding... but I need you to help me understand what I do not. Please, post comments so that I can learn from you. Here are the instructions for this portion of the project: Create the Monkey class, using the specification document as a guide. The Monkey class must do the following: Inherit from the RescueAnimal class Implement all attributes with appropriate data structures Include accessors and mutators for all implemented attributes Here is...
java questions: 1. Explain the difference between a deep and a shallow copy. 2. Given the below classes: public class Date { private String month; private String day; private String year; public Date(String month, String day, String year) { this.month = month; this.day = day; this.year = year; } public String getMonth() { return month; } public String getDay() { return day; } public String...
java This lab is intended to give you practice creating a class with a constructor method, accessor methods, mutator methods, equals method , toString method and a equals method. In this lab you need to create two separate classes, one Student class and other Lab10 class. You need to define your instance variables, accessor methods, mutator methods, constructor, toString method and equals method in Student class. You need to create objects in Lab10 class which will have your main method...
// Client application class and service class Create a NetBeans project named StudentClient following the instructions provided in the Starting a NetBeans Project instructions in the Programming Exercises/Projects Menu on Blackboard. Add a class named Student to the StudentClient project following the instructions provided in the Starting a NetBeans Project instructions in the Programming Exercises/Projects Menu on Blackboard. After you have created your NetBeans Project your application class StudentC lient should contain the following executable code: package studentclient; public class...
Using your Dog class from earlier this week, complete the following: Create a new class called DogKennel with the following: Instance field(s) - array of Dogs + any others you may want Contructor - default (no parameters) - will make a DogKennel with no dogs in it Methods: public void addDog(Dog d) - which adds a dog to the array public int currentNumDogs() - returns number of dogs currently in kennel public double averageAge() - which returns the average age...
Writing 3 Java Classes for Student registration /** * A class which maintains basic information about an academic course. */ public class Course { /** * Attributes. */ private String code; private String title; private String dept; // name of department offering the course private int credits; /** * Constructor. */ public Course(String code, String title, int credits) { // TODO : initialize instance variables, use the static method defined in // Registrar to initialize the dept name variable...
Inheritance and Polymorphism (use Pet.java) You are given a class named Pet.java. Create two child classes named Cat.java and Dog.java. Cat.java should add attributes for color and breed. Dog.java should add attributes for breed and size (use String for small, medium, large). Add appropriate constructors, getter/setter methods and toString() methods. In a separate file named PetDriver.java, create a main. In the main, create an ArrayList of Pet. Add an instance of Cat and an instance of Dog to the ArrayList....
Java file Name Dog Classes and Methods Create a constructor that incorporates the type, breed, and name variables (do not include topTrick). Note: The type refers to what the breed typically does; for example, a corgi would be a “cattle herding dog.” A Shiba Inu would be a “hunting dog.” Create the setTopTrick() mutator method Dog is parent class Corgi and Driver are subclasses Complete the Corgi class: Using the UML Class diagram, declare the instance variables. Create the two...
For this project you will be writing up a simple Clock program to keep track of time. SimpleClock.java - contains your implementation of the SimpleClock class. You will need to provide the code for a constructor as well as the mutator methods set and tick and the accessor method toString. Look at the comments for each method to see how they should be implemented - the trickiest method is probably tick, which requires that you deal with the changing of...
PART 1: GETTING STARTED 1. Create a new Java Project. 2. Create a new Tree class and enter this code. You do not have to type in the comments public class Tree { private String name; private int age; private bogJsAn evergreen; // true if evergreen // false if deciduous //CONSTRUCTORS public Tree( { name 0; evergreen = true; age } // you fill this one public Tree (String n, jnt a, bgalean e) //PUT YOUR CODE HERE } //...