3.24 Program: Drawing a half arrow (Java) 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 *'s, and the outer loop iterates a number of times equal to the height of the arrow base. (1 pt) (3) 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) (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 (arrowHeadWidth <= arrowBaseWidth) { System.out.println("Enter arrow head width: "); arrowHeadWidth = scnr.nextInt(); } Example output for arrowBaseHeight = 5, arrowBaseWidth = 2, and arrowHeadWidth = 4: Enter arrow base height: 5 Enter arrow base width: 2 Enter arrow head width: 4 ** ** ** ** **** *** **

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.3: Interactive While Loops
Problem 6E: (Conversion) a. Write a C++ program to convert meters to feet. The program should request the...
icon
Related questions
Question

I need help writting this code. And figuring out what to put in for "users input" in the picture down below.

DrawHalfArrow.java
Load default template...
1 import java.util.Scanner;
2
3 public class DrawHalfArrow {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
0;
0;
0;
4
6
int arrowBaseHeight
7
int arrowBaseWidth
8
int arrowHeadWidth
%3D
9
10
System.out.println("Enter arrow base height: ");
arrowBaseHeight
11
scnr.nextInt();
12
System.out.println("Enter arrow base width: ");
scnr.nextInt();
13
14
arrowBaseWidth
15
Run your program as often as you'd like, before submitting for grading. Below, type any needed
input values in the first box, then click Run program and observe the program's output in the
Develop mode
Submit mode
second box.
Enter program input (optional)
If your code requires input values, provide them here.
Transcribed Image Text:DrawHalfArrow.java Load default template... 1 import java.util.Scanner; 2 3 public class DrawHalfArrow { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); 0; 0; 0; 4 6 int arrowBaseHeight 7 int arrowBaseWidth 8 int arrowHeadWidth %3D 9 10 System.out.println("Enter arrow base height: "); arrowBaseHeight 11 scnr.nextInt(); 12 System.out.println("Enter arrow base width: "); scnr.nextInt(); 13 14 arrowBaseWidth 15 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the Develop mode Submit mode second box. Enter program input (optional) If your code requires input values, provide them here.
3.24 Program: Drawing a half arrow (Java)
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 *'s, and the outer loop iterates a number of times equal to the height of the arrow base. (1 pt)
(3) 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)
(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 (arrowHeadWidth <= arrowBaseWidth)
{
System.out.println("Enter arrow head width: ");
arrowHeadWidth = scnr.nextInt();
}
Example output for arrowBaseHeight = 5, arrowBaseWidth = 2, and arrowHeadWidth = 4:
Enter arrow base height: 5
Enter arrow base width: 2
Enter arrow head width: 4
**
**
**
**
**
****
***
**
Transcribed Image Text:3.24 Program: Drawing a half arrow (Java) 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 *'s, and the outer loop iterates a number of times equal to the height of the arrow base. (1 pt) (3) 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) (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 (arrowHeadWidth <= arrowBaseWidth) { System.out.println("Enter arrow head width: "); arrowHeadWidth = scnr.nextInt(); } Example output for arrowBaseHeight = 5, arrowBaseWidth = 2, and arrowHeadWidth = 4: Enter arrow base height: 5 Enter arrow base width: 2 Enter arrow head width: 4 ** ** ** ** ** **** *** **
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Mergesort
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr