Skip to content

A Java Swing application designed to calculate the perimeter and area of various polygons such as squares, rectangles, circles, and triangles.

Notifications You must be signed in to change notification settings

JimHendrixBag-eo/Computer-Programming-2-Midterms-GroupProject2-PERIMETER-AND-AREA-SOLVER

Repository files navigation

Perimeter and Area Calculator

image

Overview

This Java application efficiently calculates the perimeter and area of squares, rectangles, triangles, and circles.

Features

  • Calculate perimeter and area for various shapes.
  • Support for squares, rectangles, triangles, and circles.
  • User-friendly graphical user interface (GUI).
  • Clear and concise output.

Installation

  1. Clone the repository to your local machine.
  2. Open the project in your preferred Java IDE.
  3. Build and run the Tester class.

Usage

  1. Select whether you want to calculate the area or perimeter from the dropdown menu.
  2. Choose the type of polygon you want to calculate the area or perimeter for from the second dropdown menu.
  3. Enter the required dimensions in the provided input fields.
  4. Click the "Calculate" button to obtain the result.
  5. To clear the input fields, click the "Clear" button.
  6. To exit the application, click the "Exit" button.

Supported Shapes

  • Square: Calculate area and perimeter by providing the length of one side.
  • Rectangle: Calculate area and perimeter by providing the length and width.
  • Triangle: Calculate area and perimeter by providing the lengths of all three sides.
  • Circle: Calculate area and perimeter by providing the radius.

Classes

  • Shape: An abstract class representing a geometric shape with methods to calculate area and perimeter.
  • Square: A concrete class representing a square, extending the Shape class.
  • Rectangle: A concrete class representing a rectangle, extending the Shape class.
  • Triangle: A concrete class representing a triangle, extending the Shape class.
  • Circle: A concrete class representing a circle, extending the Shape class.

About

A Java Swing application designed to calculate the perimeter and area of various polygons such as squares, rectangles, circles, and triangles.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages