1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vagabundo [1.1K]
3 years ago
8

Given two input integers for an arrowhead and arrow body, print a right-facing arrow. Ex: If the input is 0 1, the output is

Engineering
1 answer:
Lyrx [107]3 years ago
8 0

For printing a right facing with input 01, define the class for right facing arrow and give the value with appropriate space using '%6d'  and then display the right facing arrow.

Further Explanation:

The code to print the arrowhead and arrow body is as follows:

Import java.util.Scanner;

//Define the method.

public class RightfacingArrow

{

//Define the main method.

public static void main(String[] args)

{

//Create an object of Scanner class.

Scanner object = new Scanner(System.in);

//Declare the variables.

int baseChar;

int headChar;

//Prompt the user to enter the input values.

baseChar = object.nextInt();

headChar = object.nextInt();

 

//Display the headchar in position 6 from the  starting.

System.out.printf("%6d ", headChar);

//Display the arrows.

System.out.println(baseChar+""+baseChar+""

+baseChar+""+baseChar+""+baseChar+""

+headChar+""+headChar);

System.out.println(baseChar+""+baseChar

+""+baseChar+""+baseChar+""+baseChar

+""+headChar+""+headChar+""+headChar);

System.out.println(baseChar+""+baseChar

+""+baseChar+""+baseChar+""

+baseChar+""+headChar+""+headChar);

//Display the headchar in position 6 from the  starting.

System.out.printf("%6d ", headChar);

}

}

Output:

If the input is 01, the output will be as below:

    1

0000011

00000111

0000011

    1

Learn more:

1. A company that allows you to license software monthly to use online is an example of ? brainly.com/question/10410011  

2. Prediction accuracy of a neural network depends on _______________ and ______________. brainly.com/question/10599832  

Answer details:

Grade: College Engineering

Subject: Computer Science and Enginnering

Chapter: Java Programming

Keyword:

Java, input, output, programming, statements, if-else, loops, print, scan. right facing arrows, body, main body, char, int, variables, scanner class, abstract class, constructor, desctructor

You might be interested in
A 16 Kb (=16,384 bit) memory array is designed as a square with an aspect ratio of one (number of rows is equal to the number of
melisa1 [442]

Answer:

7

Explanation:

The structure of memory chip is given by multiplying the number of rows and column ie M X N

he number of address line required for row decoder is n where M =2^{n} or expressed in logarithmic form we have

n= log_2 M

In this case M=N since number of rows is equal to the number of columns

Therefore, M X N= M x M= M^{2}=16 kb=16384 b= 2^{4} \times 2^{10}= 2^{14}

M^{2}= 2^{14}

Therefore,

M=128

Since n=log_2 M

n=log_2 128=7

Therefore, address lines should be at least 7

7 0
4 years ago
The difference in potential energy between an electron at the negative terminal and one at the positive terminal is called the _
tensa zangetsu [6.8K]

Answer:

potential difference

Explanation:

voltage = potential difference

dont confuse potential energy with electrical potential though.

5 0
3 years ago
30) Based on the figure below, what is the minimum number of views necessary to fully describe the
nalin [4]

\huge\underline\mathtt\colorbox{cyan}{3}

Since the world is a 3D space, approximately.

3 0
2 years ago
Air pollutants produced by mining activities,and their characteristics​
marishachu [46]

Answer:

All activities during ore extraction, processing, handling, and transport depend on equipment, generators, processes, and materials that generate hazardous air pollutants such as particulate matter, heavy metals, carbon monoxide, sulfur dioxide, and nitrogen oxides.

Explanation:

5 0
4 years ago
Which of the following people is required by law to wear a seatbelt
Shalnov [3]

Answer:

Car drivers and front seat passengers must wear a seat belt, unless they have a medical exemption certificate. Adults travelling in the rear of a car must also use seatbelts, if they're fitted. It's the responsibility of the adult passenger (not the driver) to make sure that they are using the seatbelt.

6 0
3 years ago
Other questions:
  • A subway car leaves station A; it gains speed at the rate of 4 ft/s^2 for of until it has reached and then at the rate 6 then th
    8·1 answer
  • Steam enters an adiabatic turbine at 800 psia and9008F and leaves at a pressure of 40 psia. Determine themaximum amount of work
    10·1 answer
  • Select the correct answer.
    8·1 answer
  • Air (cp = 1.005 kJ/kg·°C) is to be preheated by hot exhaust gases in a cross-flow heat exchanger before it enters the furnace. A
    11·1 answer
  • A projectile is launched horizontally 1m above the ground. If it lands 300m away from the initial launch position, find: a)-the
    10·1 answer
  • High speed increases the risk of collision because of ALL of these things EXCEPT:
    8·1 answer
  • Describe what a dislocation is, and how it is important in the plastic deformation of materials
    14·1 answer
  • (a) Consider a germanium semiconductor at T 300 K. Calculate the thermal equilibrium electron and hole concentrations for (i) Nd
    7·1 answer
  • Show how to connect the two circuit building blocks from the previous problem to create a circuit that transforms a priority-enc
    15·1 answer
  • How many meters is equivalent to a mile?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!