Question: 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

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

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 2. Initialize the length and width with some particular values 3. For finding the perimeter of the rectangle use the 4. For finding the area of the rectangle use the 5. Show the output in the following format: the naming conventions discussed in class. (like 12.25 and 5.82) formula: perimeter 2 * (length + width) formula: arealengthwidth 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. 6. Test your program for different values of length and width. 2. Write a Java program that computes the size of a pizza and determines its price per square inch, given its diameter and price 1. Declare a class named constant (PI) for - 2. Declare variables for diameter, 3. Iniialize the diameter and price with some particular 4. For finding the size of the pizza use the 5 For finding the price per square inch 6. Show the output in the following format: 3.14159265 square inch. Use the naming conventions discussed in class. values (like 12 and 6.99) formula: size(Ddiameter) 4 formula: price-sq-inch price / size price, size and price per use thoe The size of the pizza with a diameter of xx inches is xx.xx square inches. The price per square inch for the same pizza is $xx.xx. 7. Test your program for different values of diameter and price

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!