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
Explain why slopping roofs are used in areas with heavy rain or snow fall
Savatey [412]

Answer:

Slopping or slanting roofs are found in houses where there are snow or rain, because it helps the water or the snow to skid down easily. It minimizes the chances of waterlogging because water cannot rest on the roof surface for long.

Explanation:

Brainliest pls.

8 0
3 years ago
Determine whether or not each of the following signals is periodic.
Sloan [31]

Answer:

a) periodic (N = 1)

b) not periodic

c) not periodic

d) periodic (N = 8)

e) periodic (N = 16)

Explanation:

For function to be a periodic: f(n) = f(n+N)

a) x[n]=sin(\frac{8\pi}{2}n+1)\\\\sin(\frac{8\pi}{2}n+1)=sin(4\pi n+1)

It is periodic with fundamental period N = 1

b) x[n]=cos(\frac{n}{8} -\pi)\\\\\frac{1}{8} N=2\pi k

N must be integer. So it is nor periodic

c) x[n]=cos(\frac{\pi}{8} n^2)\\\\cos(\frac{\pi}{8} (n+N)^2)=cos(\frac{\pi}{8} (n^2+N^2+2nN)\\\\N^2 = 16 \:\:or\:\:2nN=16

Since N is dependent to n. So it is not periodic.

d) x[n]=cos(\frac{\pi }{2}  n) cos(\frac{\pi }{4}  n)\\\\x[n] = \frac{1}{2} cos(\frac{3\pi }{4} n) + \frac{1}{2} cos(\frac{\pi }{4} n)\\\\N_1=8\:\:and\:\:N_2=8\\

So it is periodic with fundamental period N = 8.

e) x[n]=2cos(\frac{\pi }{4}  n)+sin(\frac{\pi }{8} n)-2cos(\frac{\pi }{2} n+\frac{\pi }{6} )\\\\N_1=8\:\:and\:\:N_2=16\:\:and\:\:N_3=4

So it is periodic with N = 16.

3 0
3 years ago
A gas is compressed from an initial volume of 0.42 m3 to a final volume of 0.12 m3. During the quasi-equilibrium process, the pr
Georgia [21]

Answer:

W=-52 800\ \text{J}=-52.8\ \text{kJ}

Explanation:

First I sketched the compression of the gas with the help of the given pressure change process relation. That is your pressure change due to change in volume.

To find the area underneath the curve (the same as saying to find the work done) you should integrate the given relation for pressure change:

W=\int_{0.42}^{0.12}-1200V+500dV=-52.8\ \text{kJ}

6 0
3 years ago
All arrived at an uncontrolled intersection at the same time. which has the right-of-way?:
Molodets [167]

If two vehicles arrive at an uncontrolled intersection almost simultaneously, the driver of the car that arrived at the intersection last must give the right of way. The driver on the left has the right of way if you both arrive at the intersection at the same moment.

Which driver should yield at an uncontrolled T-intersection?

The driver of the car turning must give way to all oncoming cross traffic when two cars are approaching an uncontrolled "T" crossroads. You need to stop and give way to vehicles and pedestrians while entering a public road from a driveway or private road.

What is right of way?

When two vehicles or pedestrians are approaching from opposite directions, moving at a speed, and close enough to create a collision, one has the right to move forward legally before the other, unless the other gives way.

Learn more about uncontrolled intersection: brainly.com/question/14312150

#SPJ4

4 0
2 years ago
State three means of operating a power tool
Shtirlitz [24]
Power tools are usually run on one of the three types of power: Compressed air, electricity, or combustion
3 0
2 years ago
Other questions:
  • All circuit conductors between the service equipment, the source of a separately derived system, or other power supply source an
    5·1 answer
  • The denominator of a fraction is 4 more than the numenator. If 4 is added to the numenator and 7 is added to the denominator, th
    15·1 answer
  • The purification of hydrogen gas is possible by diffusion through a thin palladium sheet. Calculate the number of kilograms of h
    15·1 answer
  • What should you following distance be at night
    6·1 answer
  • 5) Initially, the pressure and temperature of steam inside a solid capsule is at 100-pound force per square inch absolute (psia)
    6·1 answer
  • Training is a way for employers to provide ____ to enable employees to protect themselves and others from injuries.
    9·2 answers
  • Which is an alloy made up of iron and carbon and has high compressive and tensile strength?
    11·1 answer
  • A solid steel shaft ABCDE turns freely in bearings at points A and E. The shaft is driven by the gear at C, which applies a torq
    14·1 answer
  • hey will you be a friend to my best her name is alexzicancelperez she has only one friend and that me can please be her friend a
    5·2 answers
  • Two technicians are discussing torsion bars. Technician A says that many torsion bars are adjustable to allow for ride height ad
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!