Hello! I have a program that generates a rectangle based on width and height.
---I just need to figure out how to center this if the screen was 80 characters wide.------
void drawRect(int width, int height) {
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
if ((j == 0) || (j == width - 1)) {
cout << "*";
} else if ((i == 0) || (i == height - 1)) {
cout << "*";
} else {
cout << " ";
}
}
cout << endl;
}
}