answer.
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
Elis
1 month 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:
alex41 [274]1 month ago
8 0

To print a right-facing arrow using the input 01, first create a class for the arrow and set the space value properly with '%6d' before showing the arrow.

Further Explanation:

The following code prints the arrowhead and body:

Import java.util.Scanner;

//Define the method.

public class RightfacingArrow

{

//Define the main method.

public static void main(String[] args)

{

//Create an instance of Scanner.

Scanner object = new Scanner(System.in);

//Declare the variables.

int baseChar;

int headChar;

//Ask user for input values.

baseChar = object.nextInt();

headChar = object.nextInt();

 

//Show the head character with a space of 6 from the start.

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

//Print 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

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

//Show the head character with a space of 6 from the start.

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

}

}

Output:

If you input 01, the output will appear as follows:

    1

0000011

00000111

0000011

    1

Answer details:

Grade: College Engineering

Subject: Computer Science and Engineering

Chapter: Java Programming

Keywords:

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

You might be interested in
A 50 Hz, four pole turbo-generator rated 100 MVA, 11 kV has an inertia constant of 8.0 MJ/MVA. (a) Find the stored energy in the
Mrrafil [253]

Given Information:

Frequency = f = 60 Hz

Complex rated power = G = 100 MVA

Inertia constant = H = 8 MJ/MVA

Mechanical power = Pmech = 80 MW

Electrical power = Pelec = 50 MW

Number of poles = P = 4

No. of cycles = 10

Required Information:

(a) stored energy =?

(b) rotor acceleration =?

(c) change in torque angle =?

(c) rotor speed =?

Answer:

(a) stored energy = 800 Mj

(b) rotor acceleration = 337.46 elec deg/s²

(c) change in torque angle (in elec deg) = 6.75 elec deg

(c) change in torque angle (in rmp/s) = 28.12 rpm/s

(c) rotor speed = 1505.62 rpm

Explanation:

(a) Calculate the rotor's stored energy at synchronous speed.

The stored energy is represented as

E = G \times H

Where G stands for complex rated power and H signifies the inertia constant of the turbo-generator.

E = 100 \times 8 \\\\E = 800 \: MJ

(b) If we suddenly increase the mechanical input to 80 MW against an electrical load of 50 MW, we shall find the rotor's acceleration while ignoring mechanical and electrical losses.

The formula for rotor acceleration is given by

$ P_a = P_{mech} - P_{elec} = M \frac{d^2 \delta}{dt^2} $

Where M is defined as

$ M = \frac{E}{180 \times f} $

$ M = \frac{800}{180 \times 50} $

M = 0.0889 \: MJ \cdot s/ elec \: \: deg

$ P_a = 80 - 50 = 0.0889 \frac{d^2 \delta}{dt^2} $

$ 30 = 0.0889 \frac{d^2 \delta}{dt^2} $

$ \frac{d^2 \delta}{dt^2} = \frac{30}{0.0889} $

$ \frac{d^2 \delta}{dt^2} = 337.46 \:\: elec \: deg/s^2 $

(c) If the acceleration derived in part (b) persists over 10 cycles, we will calculate both the change in torque angle and the rotor speed in revolutions per minute at the end of this duration.

The change in torque angle is expressed as

$ \Delta \delta = \frac{1}{2} \cdot \frac{d^2 \delta}{dt^2}\cdot (t)^2 $

Where t is determined from

1 \: cycle = 1/f = 1/50 \\\\10 \: cycles = 10/50 = 0.2 \\\\t = 0.2 \: sec

Consequently,

$ \Delta \delta = \frac{1}{2} \cdot 337.46 \cdot (0.2)^2 $

$ \Delta \delta = 6.75 \: elec \: deg

The change in torque in rpm/s is provided by

$ \Delta \delta = \frac{337.46 \cdot 60}{2 \cdot 360\circ } $

$ \Delta \delta =28.12 \: \: rpm/s $

The rotor speed in rpm at the culmination of this 10-cycle period is calculated as

$ Rotor \: speed = \frac{120 \cdot f}{P} + (\Delta \delta)\cdot t $

Where P indicates the number of poles on the turbo-generator.

$ Rotor \: speed = \frac{120 \cdot 50}{4} + (28.12)\cdot 0.2 $

$ Rotor \: speed = 1500 + 5.62 $

$ Rotor \: speed = 1505.62 \:\: rpm

4 0
28 days ago
An AM radio transmitter operating at 3.9 MHz is modulated by frequencies up to 4 kHz. What are the maximum upper and lower side
Mrrafil [253]

Answer:

Total bandwidth: 8 kHz

Explanation:

Data provided:

Transmitter frequency: 3.9 MHz

Modulation up to: 4 kHz

Solution:

For the upper side frequencies:

Upper side frequencies = 3.9 × 10^{6} + 4 × 10³

Upper side frequencies = 3.904 MHz

For the lower side frequencies:

Lower side frequencies = 3.9 × 10^{6} - 4 × 10³

Lower side frequencies = 3.896 MHz

Consequently, the total bandwidth is computed as:

Total bandwidth = upper side frequencies - lower side frequencies

Total bandwidth = 8 kHz

6 0
19 days ago
Effects of biological hazards are widespread. Select the answer options which describe potential effects of coming into contact
pantera1 [220]

Answer:

- Allergic Responses

- Events Posing Life Threats

Explanation:

Biological hazards can originate from a variety of sources such as bacteria, viruses, insects, plants, birds, animals, and humans. These can lead to numerous health issues, which may range from skin allergies and irritations to infections (like tuberculosis or AIDS) and even cancer.

7 0
27 days ago
The Machine Shop has received an order to turn three alloy steel cylinders. Starting diameter = 250 mm and length = 625 mm. Feed
alex41 [274]

Response:

The cutting speed is calculated at 365.71 m/min

Clarification:

Given parameters include

diameter D = 250 mm

length L = 625 mm

Feed f = 0.30 mm/rev

cut depth = 2.5 mm

n = 0.25

C = 700

To find

the cutting speed that ensures the tool life coincides with the cutting time for the three parts

The formula for cutting time is given as

Tc =

....................1

where D refers to diameter, L refers to length and f refers to feed while V represents speed \frac{\pi DL}{1000*f*V}

Thus, we derive

Tc = \frac{\pi (250)*625}{1000*0.3*V}

Tc = \frac{1636.25}{V}

Given the tool life is expressed as

T = 3 × Tc............................2

where T denotes tool life and Tc is the cutting duration

Calculating tool life by substituting values into equation 2 yields

T = 3 × \frac{1636.25}{V}

According to the Taylor tool formula, cutting speed is expressed as

VT^{0.25} = 700

 × V × 8.37 = 700

This yields V = 365.71

Thus, the cutting speed calculates to 365.71 m/min

5 0
9 days ago
Compute the sum with carry-wraparound (sometimes called the one's complement sum) of the following two numbers. Give answer in 8
grin007 [219]

Response:

00100111

Explanation:

We have been given;

10010110

10010000

Add them following standard binary addition rules

10010110

10010000

-------------

(1)00100110

-------------

ignore the leading (1) because it is a carry.

Increase the result by 1 to achieve a 1's complement sum

00100110 + 1 = 00100111

Final Result: 00100111

3 0
21 day ago
Other questions:
  • Who want to play "1v1 lol unblocked games 76"
    7·2 answers
  • Consider 1.0 kg of austenite containing 1.15 wt% C, cooled to below 727C (1341F). (a) What is the proeutectoid phase? (b) How
    5·1 answer
  • You are working in a lab where RC circuits are used to delay the initiation of a process. One particular experiment involves an
    13·1 answer
  • Water is flowing in a metal pipe. The pipe OD (outside diameter) is 61 cm. The pipe length is 120 m. The pipe wall thickness is
    9·1 answer
  • All MOS devices are subject to damage from:________
    7·1 answer
  • Consider a process carried out on 1.00 mol of a monatomic ideal gas by the following two different pathways.
    13·1 answer
  • The basic barometer can be used to measure the height of a building. If the barometric readings at the top and the bottom of a b
    15·1 answer
  • Can a 1½ " conduit, with a total area of 2.04 square inches, be filled with wires that total 0.93 square inches if the maximum f
    8·1 answer
  • Marble A is placed in a hollow tube, and the tube is swung in a horizontal plane causing the marble to be thrown out. As viewed
    11·1 answer
  • A cylinder with a 6.0 in. diameter and 12.0 in. length is put under a compres-sive load of 150 kips. The modulus of elasticity f
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!