Module main() // Local variables Declare Real lengthA, widthA, areaA Declare Real lengthB, widthB, areaB // Get the dimensions of rectangle A. Display "Enter the dimensions of Rectangle A." Call getRectangle(lengthA, widthA) // Get the dimensions of rectangle B. Display "Enter the dimensions of Rectangle B." Call getRectangle(lengthB, widthB) // Calculate the rectangle areas.
Module main()
// Local variables
Declare Real lengthA, widthA, areaA
Declare Real lengthB, widthB, areaB
// Get the dimensions of rectangle A.
Display "Enter the dimensions of Rectangle A."
Call getRectangle(lengthA, widthA)
// Get the dimensions of rectangle B.
Display "Enter the dimensions of Rectangle B."
Call getRectangle(lengthB, widthB)
// Calculate the rectangle areas.
Set areaA = lengthA * widthA
Set areaB = lengthB * widthB
// Compare the areas.
If areaA > areaB Then
Display "Rectangle A has the greater area."
Else
If areaB > areaA Then
Display "Rectangle B has the greater area."
Else
Display "Both rectangles have the same area."
End If
End If
End Module
// The getRectangle module gets a rectangle's length and width from
// the user and stores the input in the reference parameters length
// and width.
Module getRectangle(Real Ref length, Real Ref width)
Display "Length:"
Input length
Display "Width:"
Input width
End Module
I want flow-chart and pseudocode for this please.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 8 images