This Java console application prompts the user for the width and height of a rectangle, calculates the area, and displays the results. It includes a Rectangle
class with methods to set dimensions, compute the area, and print the values. A test class demonstrates the functionality.
- User Input: Prompts the user to input the width and height of a rectangle.
- Area Calculation: Computes the area of the rectangle based on user input.
- Result Display: Displays the calculated area to the user.
- Rectangle Class: Encapsulates the properties and methods related to rectangle dimensions and area calculation.
- Test Class: Demonstrates the functionality of the
Rectangle
class.
- Java Source Files: Located in the
src
folder.Rectangle.java
: Contains methods to set dimensions, compute the area, and print the values.RectangleTest.java
: Demonstrates the functionality of theRectangle
class.
- Dependencies: Managed in the
lib
folder. - Compiled Output: Generated in the
bin
folder by default.
- Visual Studio Code (latest version)
- Java Development Kit (JDK)
-
Open the Project:
- Open Visual Studio Code.
- Select File > Open Folder.
- Navigate to the RectangleDimensionsApp folder and open it.
-
Run the Project:
- Open a Java file from the
src
folder. - Click the Run button in the top-right corner of the editor or press F5.
- Open a Java file from the
- Use the
JAVA PROJECTS
view in Visual Studio Code to manage your dependencies. More details can be found here.
This project is licensed under the MIT License.