Question: please write in java language please include UML diagram too the other two are sample reference that how to solvr the above question . .

please write in java language
please write in java language please include UML diagram too the other
please include UML diagram too
the other two are sample reference that how to solvr the above question
two are sample reference that how to solvr the above question .
. Assignment #1 (2%) Posted on Jan 21, 2022 Due Date: Tuesday

. . Assignment #1 (2%) Posted on Jan 21, 2022 Due Date: Tuesday Jan 25, 2022, at 11:59 PM Late submission: 10% penalty per day until Friday January 28, 11:59 PM Submit to the Assignment#1 drop box in MSWord format file include screenshot of the program output Design a class named Rectangle to represent a rectangle using object-oriented concepts of abstraction, encapsulation, and exception handling. Follow the example of the Circle class with exception as posted in Module 1, which is designed using object-oriented concepts and exception handling Class Rectangle 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 data field number of Objects to count the number of Rectangles A no-arg constructor that creates a default rectangle by referring to the constructor with arguments using this keywork. A constructor that creates a rectangle with the specified width and height. Setter and getter methods to set and get width and height A method named getArea() that returns the area of this rectangle. Area = width * height A method named getPerimeter () that returns the perimeter. Perimeter - 2 (width + height). A method that returns number of rectangles objects Apply Exception handling in setter methods if height or width are set to or negative values. Program output: Draw the UML diagram for the class then implement the class. Write a TestRectangle program that creates three Rectangle objects one with width 4 and height 40. and a second one with width 3.5 and height 35.9. and a third one with width -2 and height 20. Display the width, height, area, and perimeter of each rectangle and number of rectangles - in this order. Submission on Slate: Submit only one Single MSWord file containing text of the program code (not an image of the code) and other requirements as follow: 1. UML diagram of Rectangle class 2. Text of your code(single spaced)..e. not an image of the code (Note: Apply class abstraction e and encapsulation and create a test driver class TestRectangle and a Rectangle class. 3. Include screen shot of your execution screen pasted below the text of your program code Evaluation: 2 Marks 1. UML 0.5 marks 2. Coding standard and quality (indentation, spacing comments, conventions etc.): 1 mark 3. Program output screen shot: 0.5 mark 4. Penalty mark for Late submission 10% per day up to 3 days then mark of o Template of O0 program with Exception ICE#10.0 Sample Class Construct Class Circle with Abstraction, Encapsulation, and Exception handling Program prints radius and area UML Diagram + 1/ Class program CirclewithException Circle.java Circle public class Circle -radius: double /** The radius of the circle private double le radius: - Numberofobject: int + Circle() /** The number of the objects created */ private static int number ofObjects = 0; + Circle(radius: double) /** Construct a circle with radius 1 * getRadius(): double public Circle 01 + setRadius(radius: double): void this(1.0): 1 + getNumber of objects(): int + getArea(): double /** Construct a circle with a specified radius public Circle(double newRadius) setRadius(new Radius): numberOfObjects 1 /** Return radius public double getRadius() { return radius: 1 /** Set a new radius */ public void setRadius(double newRadius) throws illegalArgumentException if (newRadius > 0) radius - newRadius: else throw new IllegalArgumentException "Radius is assigned" newRadius + "Radius cannot be zero or negative", 1 /** Return numberOfObjects public static int getNumberOfObjects return number ofObjects: 1 /** Return the area of this circle public double getAreal return radius radius * 3.14159. 0 2 of 2 Automatic Zoom Viswas Tert Download >> /** Set a new radius putnic void setkadin double safadhall throw illegally bewRadius radius - news che cambi *** Return number of objects public state in beror retumbers Return the area of this circle public double petreat return rain radius 1415 try 1/Driver Class Teedelava public class Teste public static void main(String try Circle ci-new Circle 15 Sitem.out.printl For Radi:** elgetredet) Petare **elyett 1 catch(egal Argumenteceptionell System.out.printl 1 Circle 2 new Circle - Sytem.out.printl For Bodien: 2 year 2 1 catch egal Arpament captioned System.out.prinnel try Cirde c3 - new Circle System.out.printl For Ratis: tapetailhak agak 1 catch (legalArgumentExceptioned System.out.printl System.out printomber el objects created. + berok Sample run For Radius: 5. Aris 78.53975 walang legal rgumentation Radius signed 50 Radius cannot be or negative java.langilegargumentaception Radius signed Radicannot be or negative Number of objects created: 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!