Skip to content

A program that will determine the area of a geometric shape.

Notifications You must be signed in to change notification settings

astev5/area-of-shapes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Area of Geometric Shapes

A program that will determine the area of a geometric shape.

Constraints

  • Area of a Square
    • a = side
    • A = a2
  • Area of a Circle
    • r = radius
    • A = pi*r2
  • Area of an Ellipse
    • a = radius 1
    • b = radius 2
    • A = pi*ab
  • Area of a Pentagon
    • a = side
    • A = 1/4(sqrt(5(5+2*sqrt(5))a2)

Requirements

  • Use a menu for shape choices.
  • Each shape will require one or two inputs.
  • Implement if/else statements to act on the user's shape choice outputting both the formula and the results.
  • Implement a Switch/Case blok to act on the user's shape choice outputting both the formula and the results.
  • Comment out either the if/else or switch case allowing only one set to run per session.
  • The formula should output before the results.
  • Utilize the Java Math class.

Notes

  • import static java.lang.Math.*;
  • System.exit(0);
  • System.exit(1);
  • Utilize default case in Switch/Case block.

About

A program that will determine the area of a geometric shape.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages