Ex. 1 ----- 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 default constructor that creates a default rectangle. A 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 of this rectangle. Write a class named RectangleMain 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. Ex2. ---- Write a Java class named Date.java which represents the date starting from January 1st 1900. The class shall contain the following constructors: * Date(int d, int m, int y), which constructs a date object representing a day d of month m (between 1 and 12) of year y * Date(int d, int m), which constructs a date object representing a day d of month m (between 1 and 12) of year 2008 * Date(int d), which constructs a date object representing a day d of January 2008 * Date() which constructs a date object representing February, 9th 1985 If the user tries to construct a date that doesn't exist or precedes January 1st 1900, the program should print an error message to the console (standard output). The program should also take into account leap years. Moreover the following methods should be included: * String toString(), which returns a String representation of the date, e.g. "12 march 2015" * boolean precede(Date otherDate), which returns true if and only if the object's date (i.e. this) precedes otherDate * int daysPassedSince1Jan1900(), which returns the number of days passed since January 1st 1900 (including the day represented by the object's date). Do not forget to consider leap years. * int daysPassedThisYear(), which returns the number of days passed since the beginning of this year (including the day represented by object's date). Do not forget to consider leap years. Finally, write a class DateMain.java containing a main method that creates the dates 6 June 2012 and 15 February 1977, prints them to the console, prints the result of comparing the first date with the second date, and finally prints, for both dates, the number of days that have passed since the beginning of that year and the number of days that have passed since January 1st 1900. Note: A year is a leap year if either it is divisible by 400, or it is divisible by 4 and not divisible by 100. Recall that a%b returns 0 if number a is divisible by number b.