Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Instructions Below are a number of coding problems involving finding area and perimeter of different shapes. You need to write a program in eclipse to
Instructions Below are a number of coding problems involving finding area and perimeter of different shapes. You need to write a program in eclipse to solve these problems. The program stores the length of sides for a shape as variables, computes the area or perimeter, and prints out the result of the calculation. You must use variables to store any values and any results of arithmetic operations. You must use the variables in any calculations that require them. Example Example Problem The length of the rectangle is 50. The height of the rectangle is 35. The Perimeter of a rectangle can be calculated from the formula: Perimeter = 2 * (length + width). Write a program that calculates the Perimeter of this rectangle and sends to the console a message containing what the width and height of the rectangle are as well as what the perimeter is. Example Code public class Unite3Assignmentei { public static void main(String[]args) { // create variables for the length and height of a rectangle int length = 50; int height = 35; // calculate the perimiter of the rectangle int perimeter = 2*(length + height); // Write out the message as a string String message = "The perimiter of a rectangle with length " + length + " and height " + height + " is " + perimeter; // send the message to the console System.out.println(message); Expected Output (after running in eclipse) R Problems Javadoc Declaration Console
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started