Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Hey I have hw I have to make loops that creates the letter "T" "O" and "L".

Walton CharlesWalton Charles Member Posts: 1

I'm not the best with loops ad could use some help with explanations. Thorough explanations if possible. The program asks for a size and then the letter to print. The size must be 5<= and the letter choices must be "T" "O" or "L" otherwise the program will not run. This is what I have so far. I just don't know how to make the loop part. Any help woul dbe appreciated.

include

using namespace std;
int main()
{
char T, O, L;
char letter;
int number, size;
size = number % 2;

cout << "Welcome to the letter printer." << endl;
cout << "Enter the size : " << endl;
cin >> size;

while (size <= 5 || size == 0)
{

    cout << "Invalid size. Enter the size again: ";
    cin >> size;
}

cout << "Enter the letter: " << endl;
cin >> letter;

while (letter != 'T' && letter != 'O' && letter != 'L')
{
    cout << "Invalid Letter. Enter the letter again:";
    cin >> letter;
    {


        while (letter == 'T')
        {
            for (int i = 0; i < size; i++)
            {
                for (int j = 0; j < size; j++)
                {
                    cout << "*";
                }
                cout << endl;
            }
        }
    }

}

Answers

Sign In or Register to comment.