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 15:30
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
question
Computers and Technology, 22.06.2019 20:10
Assume the existence of a bankaccount class. define a derived class, savingsaccount that contains two instance variables: the first a double, named interestrate, and the second an integer named interesttype. the value of the interesttype variable can be 1 for simple interest and 2 for compound interest. there is also a constructor that accepts two parameters: a double that is used to initialize the interestrate variable, and a string that you may assume will contain either "simple", or "compound", and which should be used to initialize the interesttype variable appropriately. there should also be a pair of functions getinterestrate and getinteresttype that return the values of the corresponding data members (as double and int respectively).
Answers: 2
question
Computers and Technology, 24.06.2019 01:00
Verify each identity[tex] \frac{csc}{cot \: x \: + \: tan \: x} = cos \: x[/tex]
Answers: 1
question
Computers and Technology, 24.06.2019 07:20
3pointsyou've found an image you want to insert into your slide presentation. youwant to make the image look more gray so that it looks like an older imagewhat would you need to adjust? 0.00o a. sizeo b. hueo c. contrasto d. tones
Answers: 2
You know the right answer?
4.14 program: drawing a half arrow (java)this program outputs a downwards facing arrow composed of...
Questions
question
Social Studies, 29.09.2019 15:00
Questions on the website: 13722363