Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Assignment # 2 Write a program that outputs a downwards facing arrow composed of a rectangle and a right triangle. Arrow dimensions are defined

Programming Assignment #2
Write a program that outputs a downwards facing arrow composed of a rectangle and a right triangle. Arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width.
Note: this program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress.
Step 1. Input the arrow base height (int) and width (int). Draw a rectangle using asterisks (height x width).
Hint: use a nested loop in which the inner loop draws one row of *s, and the outer loop iterates a number of times equal to the height.
Test Case #1
If input is:
64
Sample output is:
****
****
****
****
****
****
Step 2. Input the arrow head width and draw a right triangle.
Hint: use a nested loop.
Test Case #2
If input is:
434
Sample output is:
***
***
***
***
****
***
**
*
Step 3. Modify the program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue inputting the arrow head width until the value is larger than the arrow base width.
Test Case #3
If input is:
43324
Sample output is:
***
***
***
***
****
***
**
*
Pls coding in C++, provide class diagram and flow chart!!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

25 Vba Macros For Data Analysis In Microsoft Excel

Authors: Klemens Nguyen

1st Edition

B0CNSXYMTC, 979-8868455629

More Books

Students also viewed these Databases questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

b. Explain how you initially felt about the communication.

Answered: 1 week ago