Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_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

Semantics Of A Networked World Semantics For Grid Databases First International Ifip Conference Icsnw 2004 Paris France June 2004 Revised Selected Papers Lncs 3226

Authors: Mokrane Bouzeghoub ,Carole Goble ,Vipul Kashyap ,Stefano Spaccapietra

2004 Edition

3540236090, 978-3540236092

More Books

Students also viewed these Databases questions

Question

Describe how and why clinicians classify psychological disorders.

Answered: 1 week ago

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago

Question

What is job rotation ?

Answered: 1 week ago