Question: while ( arrowHeadWidth < = arrowBaseWidth ) { / / Prompt user for a valid arrow head value } Example output for arrowBaseHeight = 5

while (arrowHeadWidth <= arrowBaseWidth){
// Prompt user for a valid arrow head value
}
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
**
**
**
**
**
****
***
**
*
import java.util.Scanner;
public class DrawHalfArrow {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
int arrowBaseHeight;
int arrowBaseWidth;
int arrowHeadWidth;
System.out.println("Enter arrow base height:");
arrowBaseHeight = scnr.nextInt();
System.out.println("Enter arrow base width:");
arrowBaseWidth = scnr.nextInt();
System.out.println("Enter arrow head width:");
arrowHeadWidth = scnr.nextInt();
System.out.println("");
// Draw arrow base (height =3, width =2)
System.out.println("**");
System.out.println("**");
System.out.println("**");
// Draw arrow head (width =4)
System.out.println("****");
System.out.println("***");
System.out.println("**");
System.out.println("*");
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!