Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

code must be in Java. //panther ID is just like a drivers license # Description: In this test, the student is required to create a

code must be in Java.

//panther ID is just like a drivers license #

image text in transcribedimage text in transcribedimage text in transcribed
Description: In this test, the student is required to create a class called \"Park\". Park has four elds: 1) PantherID (Integer), 2) length (Integer), 3) capacity (Integer), 4) shape (String). Please fulll the methods provided below while satisfying the requirements in red. l/First Name: //Last Name: //Panther ID: public class Park { int PantherID; String YourLastName; //make sure to use your last name as the variable name private int length; private int capacity; private String shape; // 1. getLTD(): return the last two digits of the PantherID as an integer public getLTD(){} //2. getLTC(): return the last two characters of the variable YourLastName as a String. public getLTC(){} /*3. getShape(): return the shape of the park. We assume that each character is associated with a weight based on their position in the alphabet. The weight of 'a' is l, the weight of 'b' is 2, the weight of 'c' is 3, so on and so force, the weight of 'y' is 25 and the weight of 'z' is 26. For example, if the result of getLTC() is \"a \//6. Constructor with an input of PantherID and capacity. This constructor initializes all elds. (similar to previous constructor) Public Park( YourFirstNameID, capacity) {} //7. parkTypeO: return a String value based on the Capacity of the park. If the capacity is less than or equal to 30, return \"Small\"; if the capacity is larger than 30 but less than or equal to 60 return \"Medium\"; else return \"Large\". Public parkType(){} // 8. parkAreaO: return the Area value (a double) based on the shape of the park. Assume that the length is the park radius if shape is circle, otherwise length is the side length if the shape is square. public parkAreaO { } /*9. crodeevelO: the input of this method is an integer, while the output of this method is a String. We assume the input of this method is \"x\". Then, based on the equation > ; if result is less than 1, return \"NotCrowded\"; if result is larger than 1 but less than 3, return \"Crowded\"; otherwise, return \"VeryCrowded\". Note that, if the input x is larger than the capacity, the method should return \"Overload\". */ public crodeevel( ){ } (*10. Write the method: printTriange () This method creates a triangle, the length and height are the number of letters in the instance variable of YourLastName. Students only need to print only one particular triangle, based on the following table and calculating the remainder as PantherID%%. Remainder Operation Up Triangle + For-Loop UIAWN- Up Triangle + While-Loop Up Triangle + Do_While-Loop Down Triangle + For-Loop Down Triangle + While-Loop Down Triangle + Do_While-Loop For example, "Michael Jordan", with the length of last name as "Jordan" and with an odd ID of 7, will print out: * * * * * * * * * * * * * * * * * For "Tom Brady" with an even ID of 5, the printout will be: ** * * * ** * * * * * * * * * * * public printTriangle ( name) {}

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

Step: 3

blur-text-image

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Describe the characteristics used in classification

Answered: 1 week ago

Question

Explain the phyla in kingdom fungi?

Answered: 1 week ago

Question

Explain the conditions necessary for the growth of fungi?

Answered: 1 week ago