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, 23.06.2019 09:00
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the
Answers: 1
question
Computers and Technology, 23.06.2019 18:50
Ais a picture icon that is a direct link to a file or folder
Answers: 1
question
Computers and Technology, 24.06.2019 09:50
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
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
question
Chemistry, 24.10.2020 01:30
question
Mathematics, 24.10.2020 01:30
question
Mathematics, 24.10.2020 01:30
question
Mathematics, 24.10.2020 01:30
question
Mathematics, 24.10.2020 01:30
question
Biology, 24.10.2020 01:30
Questions on the website: 13722362