subject

4.14 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.(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.(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.(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. 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: 5enter arrow base width: 2enter arrow head width: 4the code to be modified is below: import java. util. scanner; public class drawhalfarrow { public static void main(string[] args) { scanner scnr = new scanner(system. in); int arrowbaseheight = 0; int arrowbasewidth = 0; int arrowheadwidth = 0; 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(); // 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("*"); return; }}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
At an open or uncontrolled intersection, yield if a. your road is paved and the crossroad is not b. the cross road is paved and yours is not c. you have two or more passengers in your vehicle d. you did not yield in the last intersection
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
question
Computers and Technology, 24.06.2019 10:20
Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should not be added to the list). these values entered by the user are added to a list we call 'initial_list'. then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. finally, inside print out all of the values in the new list. for example: input: enter value to be added to list: a enter value to be added to list: b enter value to be added to list: c enter value to be added to list: exit output: a b c a b c a b c note how 'exit' is not added to the list. also, your program needs to be able to handle any variation of 'exit' such as 'exit', 'exit' etc. and treat them all as 'exit'.
Answers: 2
question
Computers and Technology, 25.06.2019 00:30
What is a typeface? a. a collection of similar text b. a collection of similar fonts c. a collection of similar designs d. a collection of similar colors e. a collection of similar images
Answers: 1
You know the right answer?
4.14 program: drawing a half arrow (java)this program outputs a downwards facing arrow composed of...
Questions
Questions on the website: 13722362