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:
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started