GitHub / bell-kevin / rectangle
Write a class definition for a Rectangle class that contains: Two int fields, length and width Mutator and accessor methods for the length and width fields. Ask the user for these values in the mutator methods. A Boolean method named isSquare that returns true if the rectangle’s length and width are the same and false otherwise. A method that returns the perimeter of the rectangle A method that returns the area of the rectangle Write a class definition for a Rectangle Driver class that tests all of the methods. Create a Rectangle object named paper. Use the mutator methods to assign user-input values for the length and width fields Use the Boolean method to determine if paper is a square. If it is a square, print “This paper is a square: ” and the square’s dimensions If it is not a square, print “This paper is a rectangle: ” and the rectangle’s dimensions Be sure to use the accessor methods to retrieve the dimensions for printing. Print out the rectangle’s perimeter and area
JSON API: http://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bell-kevin%2Frectangle
PURL: pkg:github/bell-kevin/rectangle
Stars: 0
Forks: 0
Open issues: 0
License: gpl-3.0
Language: Java
Size: 54.7 KB
Dependencies parsed at: Pending
Created at: about 3 years ago
Updated at: about 1 year ago
Pushed at: almost 3 years ago
Last synced at: about 1 month ago
Topics: accessor, boolean, classes, methods, mutator, object-oriented-programming, oop-principles, rectangle
Funding Links https://github.com/sponsors/bell-kevin