Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help creating a Driver class in Java, can anyone help?? Grazioso Salvare has provided you with a specification document detailing its software needs.

I need help creating a Driver class in Java, can anyone help??

Grazioso Salvare has provided you with a specification document detailing its software needs. Other members of the Global Rain development team have started creating the RescueAnimal.java, Dog.java, and Driver.java class files. Your team lead has asked you to modify the existing classes and create a Monkey.java class as your contribution to the team.

  1. To gain a clear understanding of the clients software requirements, review the Grazioso Salvare specification document in the Supporting Materials section. As you read, pay close attention to the attributes and methods that you will need to implement into the program.
  1. Open the Virtual Lab by clicking on the link in the Virtual Lab Access module. Then open your IDE. Follow the IDE tutorial in the Supporting Materials section to upload Grazioso.zip into your IDE. This zipped folder contains three class files. Once you upload the files, compile the code. Although the program is not complete, it will compile without error.
  1. Read through the code for each class. This will help you understand what code has been created and what code must be modified or created to meet the software requirements.
  1. Before you begin modifying and creating classes, your team lead reminds you to demonstrate industry standard best practices in all your code to ensure clarity, consistency, and efficiency among all software developers working on the program. This includes ensuring the following:
    • In-line comments denote your changes and briefly describe the functionality of each method or element of the class
    • Appropriate variable and method naming conventions are used throughout your code
  1. Once you have completed your pre-work, you are ready to begin your assigned tasks. To start, modify the RescueAnimal.java class file by adding accessor and mutator methods for each instance variable.
  1. 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
  1. Select a method from the Software Requirements section of Grazioso Salvares specification document. Using the selected method, modify the Driver.java class file to do the following:
    • Implement the method you have chosen
    • Add attributes, as needed, to support the required functionality

Here is what I have so far...

Rescue Animal

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() { }

// Add Accessor 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 void setAcquisitionDate(SimpleDateFormat acuisitionDate){ this.acquisitionDate=acquisitionDate; } public SimpleDateFormat getStatusDate() { return statusDate; } public void setStatusDate(SimpleDateFormat statusDate){ this.statusDate=statusDate; } public void setAcquisitionSource(String acquisitionSource) { this.acquisitionSource=acquisitionSource; } public Boolean getReserved() { return 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(String inServicePOC) { return inServicePOC; } public void setInServocePOC(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 getInServiePostalAddress() { return inServicePostalAddress; } public void setInServiePostalAddress(String inServicePostalAddress) { this.inServicePostalAddress=inServicePostalAddress; }

}

Dog

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

public class Monkey extends RescueAnimal { enum Species{ CAPUCHIN,GUENON,MACAQUE,MARMOSET,SQUIRRELMONKEY,TAMARIN; } private float taillength,height,bodyLength,torsoLength,skullLength,neckLength; Species species; public float getTaillength() { return taillength; } public float getHeight() { return height; } public void setHeight(float height) { this.height=height; } public float getBodyLength() { return bodyLength; } public void setBodyLength(float bodyLength) { this.bodyLength=bodyLength; } public float getTorsoLength() { return torsoLength; } public void setTorsoLength(float torsoLength) { this.torsoLength=torsoLength; } public float getSkullLength() { return skullLength; } public void setSkullLength(float skullLength) { this.skullLength=skullLength; } public float getNeckLength() { return neckLength; } public void setNeckLength(float neckLength) { this.neckLength=neckLength; } public Species getSpecies() { return species; } public void setSpecies(Species species){ this.species=species; }

}

Specifications

About Our Company Grazioso Salvare is a rescue animal training company that was established in 1965. We have locations in Chile, Greece, Japan, Madagascar, Singapore, South Korea, Turkey, the United Kingdom, and the United States. We have trained thousands of dogs as rescue animals and are starting to train monkeys as well. Our Process We obtain dogs from local breeders and animal shelters. Each dog goes through a six- to ninemonth training regimen before they are put into service. Grazioso Salvare uses the term service to indicate that an animal has been provided to a client. Once put into service, the animals are considered rescue animals. A rescue animal, sometimes referred to as a search and rescue animal, is trained to rescue other animals or humans from difficult (or even lifethreatening) situations. Part of our process is to record and track several data points about the rescue animals. Dogs are given the status of intake before training starts. Once in training, they move through a set of five rigorous phases: Phase I, Phase II, Phase III, Phase IV, and Phase V. While in training, a dog is given the status of its current training phase (e.g., Phase I). When a dog graduates from training, it is given the status of in service and is eligible for use by clients. If a dog does not successfully make it through training, it is given the status of farm, indicating that it will live a life of leisure on a Grazioso Salvare farm. We currently have a farm at each of our training facilities, so there is no need to relocate animals. Our Vision In recent years, law enforcement agencies from several countries have expressed an interest in obtaining and training rescue animals that are more capable than a traditional rescue dog. Though dogs have proven very capable, recent research indicates that primates have higher levels of attention and greater potential to perform rescue functions. To support this demand, we started training monkeys to become rescue animals. We currently have 19 monkeys of various species in the training pipeline. To date, no monkeys have been put into service as rescue animals. The Animals Through years of experience, we have narrowed the list of dog breeds eligible for rescue training to the following: American pit bull terrier Beagle Belgian Malinois Border collie Bloodhound Coonhound English springer spaniel German shepherd German shorthaired pointer Golden retriever Labrador retriever Nova Scotia duck tolling retriever Rough collie Smooth collie When we acquire a dog, we record the breed, gender, age, weight, date, and the location where we obtained them. There is usually a short lag time between when we acquire a dog and when they start training, which we document as well. Additionally, we track graduation dates, dates dogs are placed into service, and details about the dogs in-service placement (agency, city, country, and name, email address, phone number, and mailing address for the agencys point of contact). Special Note on Monkeys As we explore the use of monkeys as service animals, we want our system to support monkey tracking as well as dog tracking. We have identified the following monkey species that are eligible for our program: Capuchin Guenon Macaque Marmoset Squirrel monkey Tamarin There are important data elements for monkeys in addition to what we use for dogs. These include tail length, height, body length, species, and measurements for torso, skull, and neck. Software Requirements We desire a software application that will help us track the animals we are currently training and the animals that have been placed into service. Here are some specifics: Ability to process requests for a rescue animal: In this case, we would receive the type of animal the customer wants and the country where the customer resides. If we have an animal in training in their country, we can reserve that animal for the customer. Ability to update any information we have on our animals Ability to see what animals we have in each phase at each location, including intake and farm Ability to add animals (intake) Ability to transfer service animals to the farm or place in-service Ability to view which animals are in-service Ability to process and receive reports from in-service agencies on the retirement or death of their rescue animal

Any help with Driver would be greatly appreciated!!

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_2

Step: 3

blur-text-image_3

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

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

2 What participation techniques are used?

Answered: 1 week ago