Respuesta :
Answer:
Explanation:
The following code is written in Java, it is a function/method that takes in the length and width of the Rectangle as parameters and then overwrites the width to match the length. Then it prints both the length and width.
public static void rectangleToSquare(int width, int length) {
width = length;
System.out.println("Width: " + width);
System.out.println("Length: " + length);
}
The program takes the dimension of rectangle and transforms the width to the value of the length in other to be use to calculate the value of square. The program goes thus :
def change_width(length, width):
#initialize a function which takes two parameters
width = length
#assign the value of length to width
return length * width
#returns the area of square
print(change_width(6,2))
A sample run of the program is attached.
Learn more : https://brainly.com/question/15180104
