Based on the classes Point, Circle, and Cylinder considered in class, create a project containing classes Point (you can use one of those discussed in class), Line, and Rectangle. The class Line should extend the class Point, adding the member variable, say, length representing the length of the line (assume that a line is horizontal and defined by a point representing its left end and its length); it should contain appropriate methods for setting and getting the length. The class Rectangle should extend Line (representing the widthof the rectangle) and have the member variable representing the height of the rectangle. The class must have methods set and get for setting and getting the height of the rectangle. The class Rectangle should also contain methods for computing the area and the perimeter of a rectangle. All the classes should have appropriate methods toString. Create also a test class (containing main) that would create few objects of Points, Lines, and Rectangles(at least two of each class!), would compute and print out areas and perimeters of the rectangles, and would print complete information about each object (using appropriate methods toString).
To implement inheritance, you can use either specifiers protected for the length and the height, or private, making sure in the latter case that appropriate methods in Line and Rectangle use call to super.
Make sure that the test program runs. Submit a zip file of your NetBeans project using the assignment on the BlackBoard.
25 freelancers están ofertando el promedio de $12 para este trabajo
Hi, I have an MS in software engineering with 6 yrs of experience in java. I regularly work on such assignments. I've read and understood the requirements well. I can do this quick. Regards, Deepak Mishra
Greetings! I am an experienced OOP programmer with top-notch Java programming skills. I can deliver this task quickly with 100% correctness. Looking forward to completing another Java assignment with excellent results.
It seems a homework of object oriented programming course. I'm still in college with 3.69 GPA and I did too many similar projects for myself and half of my classmates.