Question: PROGRAM C: please add comments This program outputs an upwards facing arrow composed of a right triangle and a rectangle. The arrow dimensions are defined
PROGRAM C: please add comments
This program outputs an upwards facing arrow composed of a right triangle and a rectangle. The arrow dimensions are defined by user specified arrow head width, arrow base height, and arrow base width.
(1) Modify the given program to use a loop to output an arrow head of width arrowHeadWidth. Use a nested loop in which the inner loop draws the *s, and the outer loop iterates a number of times equal to the height of the arrow head. (2 pts)
(2) Modify the given program to use a loop to output an arrow base of width arrowBaseWidth and height arrowBaseHeight. Use a nested loop in which the inner loop draws the *s, and the outer loop iterates a number of times equal to the height of the arrow base. (2 pts)
(3) Modify the given program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue prompting the user for an arrow head width until the value is larger than the arrow base width. (1 pt)
Example output for arrowBaseHeight = 5, arrowBaseWidth = 2, and arrowHeadWidth = 4:
Enter arrow head width: 4 Enter arrow base height: 5 Enter arrow base width: 2
* ** *** **** ** ** ** ** **
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
