Question: #include #include using namespace std; // This program uses a structure to hold data about a rectangle // PLACE YOUR NAME HERE // Fill in

#include #include using namespace std; // This program uses a structure to hold data about a rectangle // PLACE YOUR NAME HERE // Fill in code to declare a structure named rectangle which has // members length, width, area, and perimeter all of which are floats int main() { // Fill in code to define a rectangle variable named box cout << "Enter the length of a rectangle: "; // Fill in code to read in the length member of box cout << "Enter the width of a rectangle: "; continues 206 LESSON SET 11 Structures and Abstract Data Types // Fill in code to read in the width member of box cout << endl << endl; // Fill in code to compute the area member of box // Fill in code to compute the perimeter member of box cout << fixed << showpoint << setprecision(2); // Fill in code to output the area with an appropriate message // Fill in code to output the perimeter with an appropriate message return 0; } Exercise 1: Fill in the code as indicated by the comments in bold. Exercise 2: Add code to the program above so that the modified program will determine whether or not the rectangle entered by the user is a square. Sample Run: Enter the length of a rectangle: 7 Enter the width of a rectangle: 7 The area of the rectangle is 49.00 The perimeter of the rectangle is 28.00 The rectangle is a square. LAB 11.2 Initializing Structures Bring in program init_struct.cpp from the Lab 11 folder. The code is shown below

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