Question: Write a C++ program called starT that will draw a T out of asterisks based on the user's input. Suppose we want a program to

Write a C++ program called "starT" that will draw a T out of asterisks based on the user's input.

Suppose we want a program to draw a T with width 3 and height 2, we will run your starT executable as follows: $./starT 3 2

Rules for starT:

- EVERY line of your T should have exactly the same number of characters and should end in a newlineremember to pad out each line with spaces.

- Return a string that represents the letter T with the correct width and height, but only if height >=2, and width is an odd number >=3

- If the height and width values are not valid, return an empty string

- If there are not exactly two command line args after the program name (one for width and one for height), print a usage message: Usage: ./starT width height

For example:

Write a C++ program called "starT" that will draw a T out

Function call ReturnsFunction call ReturnsFunction call Returns Function call ReturnsFunction call Returns starT (5,1) starT/6,1) starT (3,1) starT(4,1) starT(7,1) starT(3,2) starT(4,2) starT (5,2) starT(6,2) starT (7,2) starT (3,3) starT(4,3) starT(5,3) starT(6,3) starT (7,3) starT (3,4) starT(4,4) starT (5,4) starT (6,4) starT(7,4)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!