Geometry Program
Description
This program uses several methods to calculate the rectangle and the right triangle's areas and perimeters, and calculate the circle's area and circumference.It also demonstrates the concepts of global and local variables.
Associated Concepts:
Method
Global and local variables
Global and local variables
Algorithm:
Declare and create keyboard as a global variable so it is available to
all the methods in the program.
main method:
Write method definitions
main method:
Declare local variables
Input data from the keyboard
Call methods and pass arguments to get the results
Print the results
Input data from the keyboard
Call methods and pass arguments to get the results
Print the results
Write method definitions
calRecArea
calRecPerimeter
calCirArea
calCirCumference
hypotenuse
calTriArea
calTriPerimeter
calRecPerimeter
calCirArea
calCirCumference
hypotenuse
calTriArea
calTriPerimeter