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 06:30
Requirement types discussed during software development include functional and color scheme nonfunctional and code style constraint and nonfunctional fashionable and functional.
Answers: 2
question
Computers and Technology, 22.06.2019 16:30
Primary tech skills are skills that are necessary for success in online education
Answers: 3
question
Computers and Technology, 22.06.2019 23:30
Define a function printfeetinchshort, with int parameters numfeet and numinches, that prints using ' and " shorthand. ex: printfeetinchshort(5, 8) prints: 5' 8"
Answers: 1
question
Computers and Technology, 23.06.2019 00:20
Ihave been given the number of guns per 100, and the total firearm-related deaths per 100,000. i have to find the actual number of guns per country and actual number of gun-related deaths. if somebody could show me how to do 1 question, i can finish the rest, i am just confused. tia
Answers: 3
You know the right answer?
4.14 program: drawing a half arrow (java)this program outputs a downwards facing arrow composed of...
Questions
question
Mathematics, 06.11.2020 22:50
question
English, 06.11.2020 22:50
question
Mathematics, 06.11.2020 22:50
question
Computers and Technology, 06.11.2020 22:50
question
Arts, 06.11.2020 22:50
Questions on the website: 13722361