2 //This Program utilizes a function to calculate the square's area.
3
4
5 #include
6 using namespace std;
7 double getLength();
8 double getLength2();
9 double getArea(double length, double length2);
10 void displayData(double length, double length2, double area);
11
12 int main()
13 {
14 double length,length2, area;
15
16 length = getLength();
17 length2 = getLength2();
18 area = getArea(length,length2);
19 displayData(length,length2,area);
20
21 return 0;
22 }
23
24 double getLength()
25 {
26 double length;
27
28 cout << " Hola,:) enter the first length of the square: "<>length;
30
31 return length;
32 }
33
34 double getLength2()
35 {
36 double length2;
37
38 cout<<" Hola, :) enter the second length of the square: "<>length2;
40
41 return length2;
42 }
43
44 double getArea(double length, double length2)
45 {
46
47 return length * length2;
48
49 }
50
51 void displayData(double length, double length2, double area)
52 {
53
54 cout<<" Congrats,You figured out that the first length is: "<
What I have tried:
2 //This Program utilizes a function to calculate the square's area.
3
4
5 #include
6 using namespace std;
7 double getLength();
8 double getLength2();
9 double getArea(double length, double length2);
10 void displayData(double length, double length2, double area);
11
12 int main()
13 {
14 double length,length2, area;
15
16 length = getLength();
17 length2 = getLength2();
18 area = getArea(length,length2);
19 displayData(length,length2,area);
20
21 return 0;
22 }
23
24 double getLength()
25 {
26 double length;
27
28 cout << " Hola,:) enter the first length of the square: "<>length;
30
31 return length;
32 }
33
34 double getLength2()
35 {
36 double length2;
37
38 cout<<" Hola, :) enter the second length of the square: "<>length2;
40
41 return length2;
42 }
43
44 double getArea(double length, double length2)
45 {
46
47 return length * length2;
48
49 }
50
51 void displayData(double length, double length2, double area)
52 {
53
54 cout<<" Congrats,You figured out that the first length is: "<