Question: 1.pdf Programming Lab Assignment 1 (50 points) Instructions. Please submit the answer on iCollege at the end of the class 1. Write a class called
1.pdf Programming Lab Assignment 1 (50 points) Instructions. Please submit the answer on iCollege at the end of the class 1. Write a class called Rectangle that represents a rectangular two-dimensional region. Your Rectangle objects should have the following methods public Rectangle(int x, int y, int width, int height) Constructs a new Rectangle whose top-left corner is specified by the given coordinates and with the given width and beight. Throw an IllegalArgumentException on a negative width or height. public int getHeight) Returns this Rectangle's height. public int getWidth) Returns this Rectangle's width. public int getx0 Returns this Rectangle's x-coordinate public int getyo Returns this Rectangle's y-coordinate public String toString0) Returns a String representation of this Rectangle, such as "Rectanglefx-1y 2, width-3 height-4] Pleane creae a Resctampleaincsinr in class in order to create objects of the type of Rectangle class. objecta Please create a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
