subject

Create a class called Tree. It is required to have the following: 4 fields o name, String, the type of tree (pine, cedar, oak, etc.). o age, integer, the approximate age of the tree. o circumference, double, the approximate circumference of the tree (in inches). omarker, boolean, indicates if the tree has a marker on it. This is true if it has a marker and false if it doesn't. 7 methods o a constructor that accepts as arguments the values for the fields above, in the order listed. o a copy constructor that makes a copy of a Tree object. o a setCircumference method that accepts a double argument, which is used to set the circumference field. o a setMarker method that accepts a boolean argument, which is used to set the marker field. o a radius method that has no arguments and returns a double that is the radius of the tree. The radius can be calculated as radius = circumference /(2 x PI). Pl is 3.14. o an equals method that returns a boolean indicating if two objects contain the same information. If they do, it returns true, false otherwise. The objects contain the same information when the name and age fields indicate the same values. o a toString method that returns a String that contains on separate lines (5 lines), the names and values for each field, and the radius. Display double values to 2 decimal places. Demonstrate your class in a program. Your demo program is required to: • create at least two Tree objects. • create a copy of a Tree object. • use each of the other five methods to show they work properly. You may have to use a method more than once to show it works properly. • do not explicitly call the toString method in your demo program. Call it implicitly. Your class and demo program are required to: • be properly commented • follow the programming conventions we used in the course have appropriate variable names the Tree class must be in a separate file. ​

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:30
Word vocabulary words: print, proofread, status line, graphics, font effects, left margin, justification, line spacing, copy/paste, data. review words: font point, bold, save, center, error. fill in the correct word for the definition and then transfer the letters to the appropriate spot by number. some numbers will be found multiple times. you will end up with a quotation about…… what else? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 k 16 17 18 19 20 21 22 23 24 25 8 27 28 29 w 31 32 k 34 35 36 w h 39 40 41 42 8 44 45 46 47 48 49 50 51 52 53 54 55 .1. a software function that records keystrokes on a disk or drive so information can be 5 4 52 9 later retrieved. p n 2. to produce a paper copy of information. 10 7 12u n 3. a display that shows the location of the cursor, pages, etc. 45 46 18 27 36 20 42p4. pictures or images, located in clip art or other files. 6 24 44 28 34 49 555. any mis-stroke of a key. 47 41 48 2 10 n6. allows major changes to the font such as shadow, emboss, etc. 21 25 46 35 23 21 29 14 22 17 n7. a feature that centers lines of text horizontally. 49 53 46 9 51 p8. size of the font 31 16 22 b l 9. a feature that prints designated text darker than the rest to add emphasis. 32 3 . p10. to compare copy on a display screen or printout to the original 24 39 25 23 54 9 50 3 and correct errors. j un 11. a feature that allows text to be aligned at the left 11 12 7 21 16 49 40 46 34 2 and right margins. leftn 12. amount of blank space on the left side of the paper. 8 18 41 6 34 linen 13. number of blank lines between lines of text. 17 4 49 13 1914. any information inputted into the computer. 3 4 46 44 p /p15. feature that duplicates text from one location and places it in another.
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Which argument is not a valid filter? does not equal this quarter filter by cell color all of these are valid filter arguments.
Answers: 2
question
Computers and Technology, 23.06.2019 20:40
Instruction active describing list features which statements accurately describe the features of word that are used to create lists? check all that apply. the tab key can be used to create a sublist. the enter key can be used to add an item to a list. the numbering feature allows for the use of letters in a list. the numbering feature can change the numbers to bullets in a list. the multilevel list feature provides options for different levels in a list.
Answers: 2
You know the right answer?
Create a class called Tree. It is required to have the following: 4 fields o name, String, the type...
Questions
question
Mathematics, 30.11.2020 20:10
question
Mathematics, 30.11.2020 20:10
question
Spanish, 30.11.2020 20:10
question
Mathematics, 30.11.2020 20:10
question
History, 30.11.2020 20:10
Questions on the website: 13722359