Problem

Complete the following program so it defines an array of 10 Yard objects. The program sh...

Complete the following program so it defines an array of 10 Yard objects. The program should use a loop to ask the user for the length and width of each yard. Then it should use a second loop to display the length and width of each yard. To do this you will need to add two member functions to the Yard class.

#include <iostream>

using namespace std;

class Yard

{

private:

int length, width;

public:

Yard()

{ length = 0; width = 0; }

void setLength(int l)

{ length = l; }

void setWidth(int w)

{ width = w; }

};

int main ()

{

// Finish this program.

}

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT