T4 Guidelines
T4 Guidelines
Q1. Follow the steps in the tutorial notes, your program should look like below:
#include <iostream>
using namespace std;
int main()
{
// declare variables
int input;
return 0;
}
}
cout << endl; // end the line of inner loop
}
4. Insert the following codes into the nested loop:
(a)
if (row == 1 || row == size || col == 1 || col == size)
cout << "*";
else
cout << " ";
(b)
if (row == 1 || row == size || row == col)
cout << "*";
else
cout << " ";
(c)
if (row == 1 || row == size || row + col == size + 1)
cout << "*";
else
cout << " ";
(d)
if (row == 1 || row == size || row == col || row + col == size + 1)
cout << "*";
else
cout << " ";
(e)
if (row == 1 || row == size || col == 1 || col == size
|| row == col || row + col == size + 1)
cout << "*";
else
cout << " ";