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
vagabundo [1.1K]
2 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]2 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
Lydia is the CEO for a large pharmaceutical manufacturer. Her company is in the final stages of FDA
weqwewe [10]
OSHA inspections are generally unannounced. In fact, except in four exceptional circumstances when advance notice may be given.


It is a criminal offense for any person to give unauthorized advance notice of an OSHA inspection.
5 0
2 years ago
A plate of an alloy steel has a plane-strain fracture toughness of 50 MPa√m. If it is known that the largest surface crack is 0.
Ivahew [28]

Answer:

option B is correct. Fracture will definitely not occur

Explanation:

The formula for fracture toughness is given by;

K_ic = σY√πa

Where,

σ is the applied stress

Y is the dimensionless parameter

a is the crack length.

Let's make σ the subject

So,

σ = [K_ic/Y√πa]

Plugging in the relevant values;

σ = [50/(1.1√π*(0.5 x 10^(-3))]

σ = 1147 MPa

Thus, the material can withstand a stress of 1147 MPa

So, if tensile stress of 1000 MPa is applied, fracture will not occur because the material can withstand a higher stress of 1147 MPa before it fractures. So option B is correct.

8 0
2 years ago
Annealing is a process by which steel is reheated and then cooled to make it less brittle. Consider the reheat stage for a 100-m
kodGreya [7K]

Complete question is;

Annealing is a process by which steel is reheated and then cooled to make it less brittle. Consider the reheat stage for a 100 mm thick plate (ρ = 7830 kg/m3, Cp = 550 J/kg K, k = 48 W/m K). The plate initially is at 200 °C and is to be heated to a minimum temperature of 550 °C. Heating is effected in a gas-fired furnace where the products of combustion at T∞ = 800 °C maintain a convection heat transfer coefficient of h = 250 W/m.K on both surfaces of the plate. How long should the plate be left in the furnace?

Answer:

860 seconds

Explanation:

We are given;

Initial Temperature; Ti = 200 °C

Minimum Temperature; T_i = 550 °C

T∞ = 800 °C

convection coefficient; h = 250 W/m².K

ρ = 7830 kg/m³

Cp = 550 J/kg K

k = 48 W/m K

Plate thickness = 100mm

Thus,L = 100/2 = 50mm = 0.05 m

Let's find the biot number from the formula;

Bi = hL/K

Bi = (250 × 0.05)/48

Bi = 0.2604

Now, lowest temperature in the slab is given as;

θ_o = (T_o - T∞)/(T_i - T∞)

θ_o = (550 - 800)/(200 - 800)

θ_o = 0.4167

Now, from online tables calculation, we can find the root of the biot number.

Thus, root of the biot number Bi = 0.2604 is;

ζ1 = 0.488 rad

Also, C1 is gotten as 1.0396

Now,formula for thermal diffusivity is;

α = k/ρc

α = 48/(7830 × 550)

α = 1.115 × 10^(-5) m²/s

Also, from online tables, f(ζ1) = 0.401

Thus, we can find the time the plate should the plate be left in the furnace from;

-(ζ1)²(αt/L²) = In 0.401

-(ζ1)²(αt/L²) = -0.9138

t = (-0.9138 × 0.05²)/-(0.488² × 1.115 × 10^(-5))

t ≈ 860 s

8 0
2 years ago
CHALLENGE ACTIVITY 1.4.1: Basic syntax errors. Type the statements. Then, correct the one syntax error in each statement. Hints:
Lunna [17]

Answer:

Lets check each statement for the errors.

Explanation:

System.out.println("Predictions are hard.");

This statement has no syntax errors. When this statement is executed the following line will be displayed:

Predictions are hard.

System.out.print("Especially ');

This statement is missing the closing quotation mark. A single quotation mark is placed instead of double quotation mark in the statement.

The following error message will be displayed when this program statement will be compiled:

Main.java:15: error: unclosed string literal

String literals use double quotes. So to correct this syntax error, the statement should be changed as follows:

System.out.print("Especially");

The output of this corrected line is as following:

Especially

System.out.println("about the future.").

In this line a period . is placed at the end of the statement instead of a semicolon ; but according to the syntax rules statements should end in semicolons.

The error message displayed when this line is compiled is as following:

Main.java:15: error: ; expected

Main.java:15: error: not a statement

So in order to correct this syntax error the statement should be changed as following:

System.out.println("about the future.");    

The output of this corrected line is as following:

about the future

System.out.println("Num is: " - userName);

There is a syntax error in this statement because of - symbol used instead of +

+ symbol is used to join together a variable and a value a variable and another variable in a single print statement.

The error message displayed when this line is compiled is as following:

Main.java:13: error: bad operand types for binary operator '-'

So in order to correct this syntax error the statement should be changed as following:

System.out.println("Num is: " + userName);

This line will print two things one is the string Num is and the other is the value stored in userName variable.

So let userName= 5 then the output of this corrected line is as following:

Num is: 5

8 0
2 years ago
Consider film condensation on a vertical plate. Will the heat flux be higher at the top or at the bottom of the plate? Why?
STALIN [3.7K]

Answer:

During film condensation on a vertical plate, heat flux at the top will be higher since the thickness of the film at the top, and thus its thermal resistance, is lower.

Explanation:

https://www.docsity.com/pt/cengel-solution-heat-and-mass-transfer-2th-ed-heat-chap10-034/4868218/

https://arc.aiaa.org/doi/pdf/10.2514/1.43136

https://arxiv.org/ftp/arxiv/papers/1402/1402.5018.pdf

8 0
2 years ago
Other questions:
  • 3. (20 points) Suppose we wish to search a linked list of length n, where each element contains a key k along with a hash value
    7·1 answer
  • Steam flows at steady state through a converging, insulated nozzle, 25 cm long and with an inlet diameter of 5 cm. At the nozzle
    11·1 answer
  • Define a function pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a pyram
    10·1 answer
  • A mass of 12 kg saturated refrigerant-134a vapor is contained in a piston-cylinder device at 240 kPa. Now 300 kJ of heat is tran
    8·1 answer
  • A three-story school has interior column bays that are spaced 25 ft apart in both directions. If the loading on the flat roof is
    7·1 answer
  • Compute the strain-hardening exponent (n) for an alloy in which a true stress of 415 MPa produces a true strain of 0.10; assume
    10·1 answer
  • Sea water with a density of 1025 kg/m3 flows steadily through a pump at 0.21 m3 /s. The pump inlet is 0.25 m in diameter. At the
    8·1 answer
  • The velocity distribution for laminar flow between parallel plates is given by u umax = 1 − ( 2y h ) 2 Where h is the distance s
    15·1 answer
  • An ideal Diesel cycle has a compression ratio of 18 and a cutoff ratio of 1.5. Determine the maximum air temperature and the rat
    9·1 answer
  • Complete the following sentence.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!