Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5.25 LAB*: Program: Drawing a half arrow Program Specifications Write a program that outputs a downwards facing arrow composed of a rectangle and a

  

5.25 LAB*: Program: Drawing a half arrow Program Specifications 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 (3 pts). 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. Submit for grading to confirm two tests pass. Ex: If input is: 6 4 Sample output is: **** **** **** **** **** Step 2 (3 pts). Input the arrow head width and draw a right triangle. Hint: use a nested loop. Submit for grading to confirm four tests pass. Ex: If input is: 4 3 4 Step 3 (4 pts). 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. Submit for grading to confirm all tests pass. Ex: If input is: 4 3 2 4 Sample output is: *** *** *** *** **** *** ** *

Step by Step Solution

3.47 Rating (157 Votes )

There are 3 Steps involved in it

Step: 1

mainpy 1 python code arrowbaseheight 3 arr... 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_2

Step: 3

blur-text-image_3

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

Managerial Economics and Business Strategy

Authors: Michael Baye, Jeff Prince

8th edition

9780077802615, 73523224, 77802616, 978-0073523224

Students also viewed these Accounting questions