Instructions: Your solution to this assignment will be submitted via Blackboard by using Word or some other editor for parts 1 and 2; Part 3 will be a java file.
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →Instructions: Your solution to this assignment will be submitted via Blackboard by using Word or some other editor for parts 1 and 2; Part 3 will be a java file. PDF or Word are great for Part 1 and Part 2. Your Java class for Part 3 should be submitted as .java file.
Part 1: Model a real world entity. completion. You may use the idea you started in class or something else. You need to include identity, at least 3 attributes, and at least 3 methods. Do this in a text-type document.
Part 2: Create a UML diagram for your object in Part 1. Be sure that you have at least one constructor to your diagram in addition to the attributes and methods. The diagram should be displayed similarly to the way we covered in class.
Part 3: Create the Java class for your object from your UML diagram in Part 2. The class should compile but you do not need to create a main to demonstrate that the class is runnable.
Problem 2: 9.1 (The Rectangle Class) pg. 360 in the textbook
Following the example of the Circle class in Section 9.2, design a class named Rectangle to represent a rectangle. The class contains:
■ Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height.
■ A no-arg constructor that creates a default rectangle.
■ A second constructor that creates a rectangle with the specified width and height.
■ A method named getArea() that returns the area of this rectangle.
■ A method named getPerimeter() that returns the perimeter.
Draw the UML diagram (using Word or some other editor) for the class and then implement the class. Write a test program that creates two Rectangle objects—one with width 4 and height 40
and the other with width 3.5 and height 35.9. Display the width, height, area,
and perimeter of each rectangle in this order.
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds