Question

5.13 Program: Drawing a half arrow (Python 3) This zyLab activity is the traditional programming assignment,...

5.13 Program: Drawing a half arrow (Python 3) This zyLab activity is the traditional programming assignment, typically requiring a few hours over a week. The previous section provides warm up exercises intended to help a student prepare for this programming assignment. This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width. (1) Modify the given program to use a loop to output an arrow base of height arrow_base_height. (1 pt) (2) Modify the given program to use a loop to output an arrow base of width arrow_base_width. (1 pt) (3) Modify the given program to use a loop to output an arrow head of width arrow_head_width. (2 pts) (4) 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) while arrow_head_width <= arrow_base_width: print ('Enter arrow head width: ') arrow_head_width = int(input()) Example output for arrow_base_height = 5, arrow_base_width = 2, and arrow_head_width = 4: Enter arrow base height: 5 Enter arrow base width: 2 Enter

arrow head width: 4 ** ** ** ** ** **** *** ** *

0 0
Add a comment Improve this question Transcribed image text
Answer #1
arrow_base_height = int(input('Enter arrow base height: '))
arrow_base_width = int(input('Enter arrow base width: '))
arrow_head_width = int(input('Enter arrow head width: '))

while arrow_head_width <= arrow_base_width:
    arrow_head_width = int(input('Enter arrow head width: '))

for i in range(arrow_base_height):
    for j in range(arrow_base_width):
        print('*', end='')
    print()
for i in range(arrow_head_width):
    for j in range(arrow_head_width - i):
        print('*', end='')
    print()

Add a comment
Know the answer?
Add Answer to:
5.13 Program: Drawing a half arrow (Python 3) This zyLab activity is the traditional programming assignment,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Program: Drawing a half arrow (Java) Instructor note: While you will be submitting this assignment through Zybooks, make...

    Program: Drawing a half arrow (Java) Instructor note: While you will be submitting this assignment through Zybooks, make sure you are still applying appropriate formatting and in-line commenting. This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width. (1) Modify the given program to use a loop to output an arrow base of height arrowBaseHeight. (1 pt)...

  • This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The...

    This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width. (1) Modify the given program to use a loop to output an arrow base of height arrowBaseHeight. (1 pt) (2) Modify the given program to use a loop to output an arrow base of width arrowBaseWidth. Use a nested loop in which the inner loop draws the...

  • 4.30 Draw a Custom Full Arrow This program outputs an upwards facing arrow composed of a...

    4.30 Draw a Custom Full Arrow This program outputs an upwards facing arrow composed of a rectangle and a triangle. The arrow characters used to draw the base and head are characters specified by the user. The dimensions are defined by user as well, specified as arrow base height, arrow base width, and arrow head width. Create a program to output an arrow that reads in the respective characters and values in a java format. Perform sanity checking on numeric...

  • 1.20 LAB: Warm up: Basic output with variables This zyLab activity prepares a student for a...

    1.20 LAB: Warm up: Basic output with variables This zyLab activity prepares a student for a full programming assignment. Warm up exercises are typically simpler and worth fewer points than a full programming assignment, and are well-suited for an in-person scheduled lab meeting or as self-practice. A variable like userNum can store a value like an integer. Extend the given program as indicated. Output the user's input. (2 pts) Output the input squared and cubed. Hint: Compute squared as userNum...

  • Need the answer in Java 1.17 LAB*: Program: ASCII art This zyLab activity is the traditional...

    Need the answer in Java 1.17 LAB*: Program: ASCII art This zyLab activity is the traditional programming assignment, typically requiring a few hours over a week. The previous sections provide warm up exercises intended to help a student prepare for this programming assignment. (1) Output this tree. (2 pts) * *** ***** ******* *** (2) Below the tree (with two blank lines), output this cat. (3 pts) /\ /\ o o = = --- Hint: A backslash \ in a...

  • In C programming language: This program will output a right triangle based on user specified height...

    In C programming language: This program will output a right triangle based on user specified height triangleHeight and symbol triangleChar. (1) The given program outputs a fixed-height triangle using a * character. Modify the given program to output a right triangle that instead uses the user-specified triangleChar character. (1 pt) (2) Modify the program to use a nested loop to output a right triangle of height triangleHeight. The first line will have one user-specified character, such as % or *....

  • Hello there, im trying to answer this question in c 4.22 LAB: Warm up: Drawing a...

    Hello there, im trying to answer this question in c 4.22 LAB: Warm up: Drawing a right triangle This program will output a right triangle based on user specified height triangleHeight and symbol triangleChar. (1) The given program outputs a fixed-height triangle using a * character. Modify the given program to output a right triangle that instead uses the user-specified triangleChar character. (1 pt) (2) Modify the program to use a nested loop to output a right triangle of height...

  • Warm up: Basic output with variables

    1.14 LAB: Warm up: Basic output with variablesThis zyLab activity prepares a student for a full programming assignment. Warm up exercises are typically simpler and worth fewer points than a full programming assignment, and are well-suited for an in-person scheduled lab meeting or as self-practice.A variable like userNum can store a value like an integer. Extend the given program as indicated.Output the user's input. (2 pts)Output the input squared and cubed. Hint: Compute squared as userNum * userNum. (2 pts)Get a second user...

  • in Java This program will output a right triangle based on user specified height triangleHeight and...

    in Java This program will output a right triangle based on user specified height triangleHeight and symbol triangleChar. (1) The given program outputs a fixed-height triangle using a character. Modify the given program to output a right triangle that instead uses the user-specified trianglechar character. (1 pt) (2) Modify the program to use a nested loop to output a right triangle of height triangleHeight. The first line will have one user-specified character, such as % or* Each subsequent line will...

  • PYTHON PROGRAMMING: DO NOT USE INPUT FUNCTION, use sys.argv (PLEASE TYPE OUT ANSWER) Modify this program:...

    PYTHON PROGRAMMING: DO NOT USE INPUT FUNCTION, use sys.argv (PLEASE TYPE OUT ANSWER) Modify this program: Write a program to calculate the bmi getcategory(): takes the bmi as a parameter and returns the bmi category. You are not allowed to change the two functions and you will use the same two functions as previously. Just modify the program so that it calculates the bmi and category for any number of pairs of height and weights. You must loop through the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT