Question: declare and initialize 4 variables with a type of double that will represent 4 side lengths of a quadrilateral ( a 4 sided polygon )

declare and initialize 4 variables with a type of double that will represent 4 side lengths of a quadrilateral (a 4 sided polygon). Choose appropriate variable names, and choose appropriate initial values for these variables.
b) declare and initialize an additional variable of type double to hold the sum of the 4 side lengths (this is the perimeter).
c) declare and initialize an additional variable of type double to hold the average of the 4 side lengths. (the average is the sum of the side lengths, divided by the number of sides, 4 in this case).
d) write a java statement to print out a message that shows the average side length. (Do not print just the average, print meaningful text along with the average).

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 Programming Questions!