Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | May 2017 |
Last Sign in: | 305 Weeks Ago, 1 Day Ago |
Questions Answered: | 66690 |
Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Write a Java program to find the perimeter and area of a rectangular field, given its length and width in yards.
Declare variables for length, width, perimeter and area. Use the naming conventions discussed in class.
Initialize the length and width with some particular values (like 12.25 and 5.82)
For finding the perimeter of the rectangle use the formula: perimeter = 2 * (length + width)
For finding the area of the rectangle use the formula:Â Â area = length * width
Show the output in the following format:
The perimeter of the rectangle with the length = xx.xx yards and the width = xx.xx yards is xx.xx yards.
The area of the rectangle with the length = xx.xx yards and the width = xx.xx yards is xx.xx square yards.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll