Question: C + + Q 1 : [ Print M or W ] Write a program to meet all the following requirements: Receive two input values.
CQ: Print M or W
Write a program to meet all the following requirements:
Receive two input values.
a An integer representing the size of the letter or to print. It represents the number
of lines of the whole letter to be printed out.
b A character which indicates to print or or "Wrong Input!". If this character is
then output a shape of M see below; if this character is W output a shape of W
Otherwise the program will print "Wrong input!".
The shape of M can be seen as two isosceles triangles without the base edges, the bottomright
vertex of the first triangle overlaps the bottomleft vertex of the second triangle. The shape of W
is the upside down the shape of
NOTE:
: When the height is less thanor equal to the output should be "Wrong input!"
: M or W should be case sensitivethat means if the input char is or the result should be
"Wrong input!"
Example :
Example :
Please input the height integer:
Do you want to print or :
W
Example :
Please input the height integer:
Do you want to print or
A
Wrong input!c
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
