*PLEASE HELP ASAP*
Pet.java
/*
* Class Pet
*
*
*
*/
public class Pet
{
/*
* Instance variables
*/
private String name;
private String species;
private String parent;
private String birthday;
/*
* Constructors
*/
public Pet( )
{
// This is a or default constructor
} //e end constructor
public Pet( String aName,
String aSpecies,
String aParent,
String aBDay )
{
setName( aName );
setSpecies( aSpecies );
setParent( aParent );
setBirthday( aBDay );
} // end full constructor
/*
* Set methods
*/
public final void setName( String aName )
{
name = aName;
} // end setName
public final void setSpecies( String aSpecies )
{
species = aSpecies;
} // end setSpecies
public final void setParent( String aParent )
{
parent = aParent;
} // end setParent
public final void setBirthday( String aBDay )
{
birthday = aBDay;
} // end setName
/*
* Get methods
*/
public final String getName( )
{
return name;
} // end getName
public final String getSpecies( )
{
return species;
} // end getSpecies
public final String getParent( )
{
return parent;
} // end getParent
public final String getBirthday( )
{
return birthday;
} // end getBirthday
/*
* toString method
*/
public String toString( )
{
return String.format( “%s, whose fur-parent is %s, is a(n) %s born on %s.%n”,
getName( ),
getParent( ),
getSpecies( ),
getBirthday( ) );
} // end toString
} // end Pet
ArrayMethods.java
/*
* Class Pet
*
*
*
*/
public class Pet
{
/*
* Instance variables
*/
private String name;
private String species;
private String parent;
private String birthday;
/*
* Constructors
*/
public Pet( )
{
// This is a or default constructor
} //e end constructor
public Pet( String aName,
String aSpecies,
String aParent,
String aBDay )
{
setName( aName );
setSpecies( aSpecies );
setParent( aParent );
setBirthday( aBDay );
} // end full constructor
/*
* Set methods
*/
public final void setName( String aName )
{
name = aName;
} // end setName
public final void setSpecies( String aSpecies )
{
species = aSpecies;
} // end setSpecies
public final void setParent( String aParent )
{
parent = aParent;
} // end setParent
public final void setBirthday( String aBDay )
{
birthday = aBDay;
} // end setName
/*
* Get methods
*/
public final String getName( )
{
return name;
} // end getName
public final String getSpecies( )
{
return species;
} // end getSpecies
public final String getParent( )
{
return parent;
} // end getParent
public final String getBirthday( )
{
return birthday;
} // end getBirthday
/*
* toString method
*/
public String toString( )
{
return String.format( “%s, whose fur-parent is %s, is a(n) %s born on %s.%n”,
getName( ),
getParent( ),
getSpecies( ),
getBirthday( ) );
} // end toString
} // end Pet
Lab 14 lnstructions Generic Methods Background Generic methods provide a way to produce functionality that works with virtually any type of object. You have already used quite a few generic methods – from the APl – without actually diving into the details. In this lab assignment, you will produce two generic methods for managing arrays Provided to You The following are provided to you These instructions Base code (ArrayMethods.java) for your completed lab . Declaration and load of four arrays Complete method printArray to use as an example Code that describes and calls the methods you will write o o o . Pet.java a class referenced ArrayMethods.java . Sample Output from your completed ArrayMethods.java (below) Requirements Write a generic method printRange: o Accept an array of any type o Accept two int values a starting point (print this object) and a stopping point (do not print this object) o Test that the range passed is valid: ” Stopping point is greater than starting point * Starting point is equal to or greater than zero ” Stopping point is equal to or less than the last subscript in the array Using a standard for loop, print all array elements from the starting point up to (and not o including) the stopping point * Write a generic method returnItem: o Accept an array of any type o Accept an int representing the subscript of the desired item o Return the desired item (regardless of type) to the calling method o No validation is needed for the passed int; if the passed value is not within the bounds of the array, an exception will be raised the Java Runtime Environment (JRE). No exception handling is required Sample Output Array integerArray contains: 1 2 3 4 5 Array doubleArray contains: 1.1 2.2 3.3 4.4 5.5 Array characterArray contains: HELO Array petArray contains: Bob, whose fur-parent is TSA, is a(n) Tortoise born on 19950315 SweetPea, whose fur-parent is Genie, is a(n) Horse born on 28030214 Little, whose fur-parent is John, is a(n) Chicken born on 20190123 Dale, whose fur-parent is Sam, is a(n) Chipmunk born on 28098527. Smokey, whose fur-parent is USPW is a(n) Bear born on 19440413 Range of integerArray contains: 2 3 Range of doubleArray contains: 2.2 3.3 Range of characterArray contains: E L Range of petArray contains: SweetPea, whose fur-parent is Genie, is a(n) Horse born on 28830214 Little, whose fur-parent is John, is a(n) Chicken born on 20190123 The item returned from integerArray is:3 The item returned From doubleArray is: 3.3 The item returned from characterArray is: L The item returned from petArray is: Little, whose fur-parent is John, is a(n) Chicken born on 28198123
Why Work with Us
Top Quality and Well-Researched Papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional and Experienced Academic Writers
We have a team of professional writers with experience in academic and business writing. Many are native speakers and able to perform any task for which you need help.
Free Unlimited Revisions
If you think we missed something, send your order for a free revision. You have 10 days to submit the order for review after you have received the final document. You can do this yourself after logging into your personal account or by contacting our support.
Prompt Delivery and 100% Money-Back-Guarantee
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & Confidential
We use several writing tools checks to ensure that all documents you receive are free from plagiarism. Our editors carefully review all quotations in the text. We also promise maximum confidentiality in all of our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.
Admissions
Admission Essays & Business Writing Help
An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.
Reviews
Editing Support
Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.
Reviews
Revision Support
If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.