C++ Create and Rotate an ASCII picture 90 degrees of USM

, write a program to draw a ASCII picture of “USM”.
Then rotate the picture for 90 degrees.

#include <iostream>
#include <fstream>
using namespace std;

void initPicture(char table[][60], int rowSize);
void displayPicture(char table[][60], int rowSize);
void drawRect(char table[][60], int rowSize, int upLeftRow, int upLeftCol, int lowRightRow, int lowRightCol);
void rotatePicture(char table[][60], int rowSize);

int main(int argc, const char * argv[])
{
//declare and initiate
char picture[60][60];
initPicture(picture, 60);

//draw U
drawRect(picture, 60, 2, 15, 14, 19)
//add your code...
char U;
cout << "U";

//draw S
//add your code...
char S;
cout << "S";

//draw M
//add your code...
char M;
cout << "M";


//display
displayPicture(picture, 60);

//rotate and display
cout << "Rotate 90 degree:\n";
rotatePicture(picture, 60);
displayPicture(picture, 60);

return 0;
}

//initiate picture
void initPicture(char table[][60], int rowSize)
{
for (int row = 0; row<rowSize; row++)
{
for (int col = 0; col<60; col++)
table[row][col] = '.';
}
}

//display picture
void displayPicture(char table[][60], int rowSize)
{
for (int row = 0; row<rowSize; row++)
{
for (int col = 0; col<60; col++)
{
cout << table[row][col];
}
cout << endl;
}
}

//draw a rectangle
void drawRect(char table[][60], int rowSize, int upLeftRow, int upLeftCol, int lowRightRow, int lowRightCol)
{
for (int row = upLeftRow; row <= lowRightRow; row++)
{
for (int col = upLeftCol; col <= lowRightCol; col++)
{
table[row][col] = 'o';
}
cout << endl;
}
}

//rotate picture 90 degree to the right
void rotatePicture(char table[][60], int rowSize)
{
for (int row = 0; row < rowSize; row++)
{
for (int rotatePicture);
{

}
}
}



this is the code i have so far and i am getting confused on what else i need to do can yall please help me out.
Last edited on
i need help getting started from this point because its not working to well for me
Topic archived. No new replies allowed.