Question: Functions Java only Instructions For this assignment you will be using functions. You will ask the user to input some numbers. The

Functions

 

Java only
 

Instructions 

 

For this assignment you will be using functions. You will ask the user to input
some numbers. The user can enter 4 numbers. You will then return if the numbers of it forms a
rectangle or a square (and if so, what is the perimeter). Remember you must use functions.
 

Sample Run:
Example 1:
Enter side 1
> 5
Enter side 2
> 3
Enter side 3
> 3
Enter side 4
> 5
Forms a rectangle with perimeter of 16
Example 2:
Enter side 1
> 5
Enter side 2
> 5
Enter side 3
> 5
Enter side 4
> 5
Forms a square with perimeter of 20
Example 3:
Enter side 1
> 5
Enter side 2
> 6
Enter side 3

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!