Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import java.util.Scanner; public class LabProgram { public static void main ( String [ ] args ) { Scanner scnr = new Scanner ( System .

import java.util.Scanner;
public class LabProgram {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
int arrowhead = scnr.nextInt();
int arrowbody = scnr.nextInt();
// Print arrowhead
for (int i =0; i <= arrowhead; i++){
for (int j =0; j < i; j++){
System.out.print("");
}
for (int k =0; k < arrowhead - i; k++){
System.out.print(arrowbody);
}
System.out.println();
}
// Print arrow body
for (int i =0; i < arrowbody; i++){
for (int j =0; j < arrowhead; j++){
System.out.print("0");
}
for (int k =0; k < arrowbody; k++){
System.out.print(arrowbody);
}
System.out.println();
}
// Print reverse arrowhead
for (int i = arrowhead -1; i >=0; i--){
for (int j =0; j < i; j++){
System.out.print("");
}
for (int k =0; k <= arrowhead - i; k++){
System.out.print(arrowbody);
}
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

Step: 3

blur-text-image

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

1. Explain how business strategy affects HR strategy.

Answered: 1 week ago