Assume a class Window with accessor methods getWidth that accepts no parameters and return an integer . Assume further an array of 3 Window elements named winarr, has been declared and initialized . Write a sequence of statements that prints out the width of the widest window in the array .
My code that doesn't work:
1 2 3 4 5
for(int i = 0; i < WINARR_SIZE; i++)
smallestWidth = min(smallestWidth, winarr[i].getSize());
cout << "The smallest width of the windows is: "
<< smallestWidth << endl;
Hints from the lab:
You almost certainly should be using: getWidth
⇒ We think you might want to consider using: if
⇒ We think you might want to consider using: { }