Point Value: 10 points Due: Thursday August 31, 2017, 4:30pm Description Write a lava program to create and test a Pentagon class The class should contain: A double data member named sideLength that specifies the side length of the pentagon. A default no-arg constructor that creates a pentagon based on default values. Accessor and mutator methods for the side length data member. o The default value for side length should be 1.0. .A constructor that creates a pentagon with a specified side length, passed as a parameter. The mutator method should check for any values less than zero. If a client attempts to set side length to a negative number, the code should set it to 0.0 instead. o A method named getArea() that returns the area of this pentagon. The implementation for this method MUST use the accessor method to access side length; it should not use direct data member access. o A method named getPerimeter) that returns the perimeter of this pentagon. The implementation for this method MUST use the accessor method to access side length; it should not use direct data member access. o Ensure that all data members and methods have appropriate visibility modifiers (public or private). Draw the UML diagram for the class and then implement the class. Write a test program that: Creates an array of 5 Pentagon objects-with side lengths of 4.0, 40.0, 3.5, 35.9, and 2.1. Has a static void method called printPentagon() that accepts a single Pentagon array as a . parameter and prints out all Pentagon information (side length, area, and perimeter) as shown in the expected output. This method should work for any length Pentagon a o NOTE: Study System.out.printf) and format designators to limit decimal places. o For example: If value contains a decimal value of 3.2934949484848309 System.out.printf("Value: %.2nn", value); will print Value: 3.29 Vn provides a new line character for System.out.printf(), starting new output on a line by itself · Side length should be limited to one decimal place, area and perimeter to 2 places. o
HOW OUR WEBSITE WORKS
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of
HIGH QUALITY & PLAGIARISM FREE.
To make an Order you only need to click PLACE ORDER on top of this page and we will direct you to our Order Page at WriteDen. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Deadline range from 6 hours to 30 days.
Once done with writing your paper we will upload it to your account on our website and also forward a copy to your email.
Upon receiving your paper, review it and if any changes are needed contact us immediately. We offer unlimited revisions at no extra cost.
Is it Safe to use our services?
We never resell papers on this site. Meaning after your purchase you will get an original copy of your assignment and you have all the rights to use the paper.
Our price ranges from $8-$14 per page. If you are short of Budget, contact our Live Support for a Discount Code. All new clients are eligible for 15% off in their first Order. Our payment method is safe and secure.
Please note we do not have prewritten answers. We need some time to prepare a perfect essay for you.
Interested in purchasing an essay from us? Click PLACE ORDER on top of this page