subject
Computers and Technology, 08.02.2021 18:40 oomale

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. (1 pt)(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. (1 pt)(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. (2 pts)(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. (1 pt)while (arrowHeadWidth <= arrowBaseWidth) { // Prompt user for a valid arrow head value}Example output for arrowBaseHeight = 5, arrowBaseWidth = 2, and arrowHeadWidth = 4:Enter arrow base height:5Enter arrow base width:2Enter arrow head width:4This is what I have: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();while (arrowHeadWidth >= arrowBaseWidth){System. out. println("Enter arrow head width:");arrowHeadWidth = scnr. nextInt();} // Draw arrow base (height = 3, width = 2)for(int i=0; i < arrowBaseHeight; ++i){for(int j=0; j < arrowBaseWidth; ++j){System. out. print("*");}System. out. println();}// Draw arrow head (width = 4)for(int i=0; i < arrowHeadWidth; ++i){for(int j=0; j < arrowHeadWidth-i; ++j){System. out. print("*");}System. out. println();}return;}}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
What is added to the < meta > tag to describe the encoding type?
Answers: 2
question
Computers and Technology, 22.06.2019 14:40
For this assignment you have to write a c program that will take an infix expression as input and display the postfix expression of the input. after converting to the postfix expression, the program should evaluate the expression from the postfix and display the result. what should you submit? write all the code in a single file and upload the .c file. compliance with rules: ucf golden rules apply towards this assignment and submission. assignment rules mentioned in syllabus, are also applied in this submission. the ta and instructor can call any students for explaining any part of the code in order to better assess your authorship and for further clarification if needed. problem: we as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in computer's language, however, it is preferred to have the operators on the right side of the operands, ie. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix write a program that takes an "infix" expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % ( example infix expression: (7-3)/(2+2) postfix expression: 7 3 2 2 result: rubric: 1) if code does not compile in eustis server: 0. 2) checking the balance of the parenthesis: 2 points 3) incorrect postfix expression per test case: -2 points 4) correct postfix but incorrect evaluation per test case: -i points 5) handling single digit inputs: maximum 11 points 6) handling two-digit inputs: 100 percent (if pass all test cases)
Answers: 3
question
Computers and Technology, 23.06.2019 17:10
Ac++an of of pi. in , pi is by : pi = 4 – 4/3 + 4/5 – 4/7 + 4/9 - 4/11 + 4/13 - 4/15 + 4/17 . ., to pi (9 ). , if 5 to pi,be as : pi = 4 - 4/3 + 4/5 - 4/7 + 4/9 = 4 – 1. + 0.8 - 0. + 0. = 3.. atoofbe to pi?
Answers: 2
question
Computers and Technology, 24.06.2019 00:00
For the following example of making a peanut butter and jelly sandwich, identify which are inputs, processes, or outputs: bread scooping and spreading peanut butter plate scooping and spreading jelly finished sandwich putting two pieces of covered bread together dirty plate crumbs
Answers: 2
You know the right answer?
This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arro...
Questions
Questions on the website: 13722363