Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a Java program to find the perimeter and area of a rectangular field, given its length and width in yards. 1. Declare variables

image text in transcribed
1. Write a Java program to find the perimeter and area of a rectangular field, given its length and width in yards. 1. Declare variables for length, width, perimeter and area. Use the naming conventions discussed in class 2. Initialize the length and width with some particular values (like 12.25 and 5.82) 3. For finding the perimeter of the rectangle use the formula: perimeter 2 (length + width) 4. For finding the area of the rectangle use the formula: area 5. Show the output in the following format: length width The perimeter of the rectangle with the length = xx.xx yards and the width xxxx yards is xx.xx yards The area of the rectangle with the length xxxx yards and the width = xx.xx yards is xx.xx square yards. Make changes to the programs so that you take input using the scanner dass (instead of using the assignment operator) and send output using System.out.printf. Floating-point numbers should have two decimals. 6. Test your program for different values of length and width

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions

Question

Understand the role of corporate design in communications.

Answered: 1 week ago