How to calculate the perimeter of a rectangle

This example shows how to calculate the peimeter of a rectangle.
First we ask the user for the width and height of the rectangle.
The input is parsed to integer values and finally we calculate the perimeter of the rectangle using the correct formula.

Search for more Java info on this site here:
Custom Search

Please type any questions here.