Write a class named Rectangle, which represents different rectangles. The private data fields are width, length, area and color. Use double for width and length and String for color. The methods are getWidth(), getLenght(), getColor() and findArea(). Use a class variable for color.
Include the above class in a program that uses it.
System.out.println("The perimeter of the first box is: " + box1.getPerimeter() + " "); System.out.println("The perimeter of the second box is: " + box2.getPerimeter() + " "); System.out.println("The perimeter of the third box is: " + box3.getPerimeter() + " ");
System.out.println("The area of the first box is: " + box1.getArea() + " "); System.out.println("The area of the second box is: " + box2.getArea() + " "); System.out.println("The area of the third box is: " + box3.getArea() + " "); } }
You may be familiar with the poignant phrase, “Work smarter, not harder.” Now, this could mean plenty of different things,…
APPROVED BY CLIENTS
My experience with assignment experts was beyond amazing. From the very beginning I must admit, I was a bit skeptical because of all the horror stories I read doing my research on which site I wanted to use. I decided on using assignment experts because they were able to do more technical coursework like building prototypes. The team was very responsive. I was able to provide all I needed and after their review, they came back with a more than reasonable price especially for all that I was asking them to do. They met every deadline before the due date and was completely open to changes if necessary. What really sold me on this site was when my professor told me I used the wrong program for my assignment. I went back to the team and they completely redid the assignment without any additional charge. This site is exceptional and I am so glad I decided to use them. I highly recommend this service.