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.
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.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.