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
Mamont248 [21]
3 years ago
10

Write a program that adds the numbers 1 through 5 into the numbers ArrayList and then prints out the first element in the list.

Engineering
1 answer:
nekit [7.7K]3 years ago
6 0

Answer:

Answer code is given below along with comments to explain each step

Explanation:

Method 1:

// size of the array numbers to store 1 to 5 integers

int Size = 5;  

// here we have initialized our array numbers, the type of array is integers and size is 5, right now it is empty.

ArrayList<Integer> numbers = new ArrayList<Integer>(Size);

// lets store values into the array numbers one by one

numbers.add(1)

numbers.add(2)

numbers.add(3)

numbers.add(4)

numbers.add(5)

// here we are finding the first element in the array numbers by get() function, the first element is at the 0th position

int firstElement = numbers.get(0);

// to print the first element in the array numbers

System.out.println(firstElement);  

Method 2:

int Size = 5;  

ArrayList<Integer> numbers = new ArrayList<Integer>(Size);

// here we are using a for loop instead of adding manually one by one to store the values from 1 to 5

for (int i = 0; i < Size; i++)  

{

// adding the values 1 to 5 into array numbers

  numbers.add(i);  

}

//here we are finding the first element in the array numbers

int firstElement = numbers.get(0);  

// to print the first element in the array

System.out.println(firstElement);  

You might be interested in
Select the correct answer.
steposvetlana [31]

Answer: Technical sales engineer

Explanation:

An analysis engineer makes use of data and other technical information in order for him or her to be able to analyze a project plan, and provide necessary solutions.

Technical sales engineers gives their clients the needed support and sales advice for their business to thrive. Technical sales engineers helps their clients in giving technical advices, answering queries, as well as introducing new products.

Design engineers are the engineers that study, and develop ideas that will be used for new products. Sometimes, they also modify systems used in production so that organizational performance can be improved.

Inspection engineers are the engineers that looks at infrastructures and identify the problems affecting them e.g oil pipelines, roads, bridges, etc so that accidents will be prevented.

Consulting engineer is an engineer that deals with the planning, and infrastructures. Their work benefits the society as a whole.

Based on the above explanation, the answer is technical sales engineer.

8 0
2 years ago
How many meters per second is 100 meters and 10 seconds
Elden [556K]

Answer:

the velocity = 10 m / sec if an object moves 100 m in 10s

5 0
2 years ago
Hot carbon dioxide exhaust gas at 1 atm is being cooled by flat plates. The gas at 220 °C flows in parallel over the upper and l
sergeinik [125]

The local convection heat transfer coefficient at 1 m from the leading edge is  0.44 \frac{W}{m^{2} \times K} ,  the average convection heat transfer coefficient over the entire plate is  0.293 \frac{W}{m^{2} \times K}and the total heat flux transfer to the plate is 61.6 KJ.

Explanation:

It is case of heat and mass transfer in which due to temperature difference between gas  and surface. Further temperature  boundary layer will developed on flat plate in longitudinal direction.  

Hot carbon dioxide exhaust gas

physical properties

r= 1.05 \frac{kg}{m^{3}}

c_p = 1.02 \frac{kJ}{Kg \times K}

m= 231 \times 10^{7}  \frac{N \times s }{m^2}

υ = 21.8 \times 10^{6}  \frac{m^2}{s}

k = 32.5 \times 10^{3} \frac{W}{m \times K}

\alpha = 30.1 \times 10^{6} \frac{m^{2}}{s}

Pr = 0.725

Apart from these other data arr given below,

v= 3 \frac{m}{s}  \\ p= 1 atm \\ L_c = 1.5m \\T_g= 220 C \\ T_s = 80 C

To find the local convection heat transfer coefficient at 1 m from the leading edge, we use correlation used for laminar flow over flat plate,

Nu = \frac{ h \times L }{k}  = 0.332 \times (Re^{\frac{1}{2} }) \times (Pr^{\frac{1}{3} })

where h= Average heat transfer coefficient

           L= Length of a plate

           k= Thermal Conductivity of carbon dioxide

           Re = Reynold's Number

           Pr  = Prandtle Number

(a) Convection heat transfer coefficient at 1 m from the leading edge

    is referred as local convection heat transfer coefficient.

   

   To find convection heat transfer coefficient at 1 m from leading edge,

  Nu = \frac{ h_local \times L }{k}  = 0.332 \times (Re^{\frac{1}{2} }) \times (Pr^{\frac{1}{3} })

  Here, first we have to find Re and Pr,

   Re = \frac{r \times v \times L}{m}

   Re = \frac{1.0594 \times 3 \times 1}{231 \times 10^{7}}

   Re = 20.63 \times  10^{-10}

   Pr number is take from physical property data and Pr is 0.725.

   Putting value of Re and Pr in main equation,

   we get

   Nu = \frac{ h_local \times 1 }{32.5 \times 10^{3}}  = 0.332 \times ( (20.63 \times 10^{-10})^{\frac{1}{2} }) \times (0.725^{\frac{1}{3} })

    h_local   = 32.5 \times 10^{3} \times  0.332 \times ( (20.63 \times 10^{-10})^{\frac{1}{2} }) \times (0.725^{\frac{1}{3} })

    h_local   =  0.44 \frac{W}{m^{2} \times K}

(b)  To find average convection heat transfer coefficient,

      it can be find out as case (a), only difference is that instead of L=1 m,        L=1.5 m would come,  

   Therefore,

    Nu = \frac{ h \times 1.5 }{32.5 \times 10^{3}}  = 0.332 \times ( (20.63 \times 10^{-10})^{\frac{1}{2} }) \times (0.725^{\frac{1}{3} })

    Finally,

      h  = \frac{0.44}{1.5}

      h  = 0.293 \frac{W}{m^{2} \times K}

(C) Total heat flux transfer to the plate is found out by,

     Q = h \times (T_g - T_s)

     Q = 0.293 \times (220-80) \\ Q= 0.293 \times 140  \\ Q= 61.6 KJ

     

     

   

   

     

   

     

   

   

 

   

   

   

   

8 0
2 years ago
What fuel do rockets use
natta225 [31]

Liquid Hydrogen is the fuel used by rockets.

Explanation:

  • Liquid hydrogen which can be chemically denoted as "LH_{2}" is often considered as the significant fuels for rocket.
  • However rocket in its lower stages uses fuels such as Kerosene and oxygen where as in the higher stages such as second and third stages it uses liquid hydrogen.
  • Liquid hydrogen is known to easily cool the nozzle and then also other parts of the rocket before mixing with the oxidizer such as the oxygen.
  • Thus liquid hydrogen helps in preventing nozzle erosion and also reduces combustion chamber.
  • Liquid hydrogen one the other hand is very expensive as 384,071 gallons of it will cost approximately $376,389.58 .

Thus liquid hydrogen is effectively used as a fuel for rocket.

8 0
3 years ago
Read 2 more answers
When measuring a Brake Drum, the Brake Micrometer is set to a Base Drum Diameter of 10 Inches plus four notches, and the dial re
kozerog [31]

Answer:

10.5

Explanation:

7 0
2 years ago
Other questions:
  • How to identify this fossil
    9·1 answer
  • What organization which fire codes
    13·2 answers
  • what is the expected life 1 inch diameter bar machined from AISI 1020 CD Steel is subjected to alternating bending stress betwee
    9·1 answer
  • Cold water at 20 degrees C and 5000 kg/hr is to be heated by hot water supplied at 80 degrees C and 10,000 kg/hr. You select fro
    14·1 answer
  • calculate the magnitude of the force acting on the pin at D. Pin C is fixed in DE and bears against the smooth slot in the trian
    9·1 answer
  • Suppose that we have a 1000 pF parallel-plate capacitor with air dielectric charged to 1000 V. The capacitors terminals are open
    13·1 answer
  • Discuss in detail the manners of interaction with opposite gender
    10·1 answer
  • An engine has a piston with a surface area of 17.31 in2 and can travel 3.44 inches. What is the potential change in volume, disp
    10·1 answer
  • Find the capacitance reactance of a 0.1 micro frequency capacitor 50Hz and at 200Hz​
    9·1 answer
  • 10.) A solid circular titanium control rod at 7,000 lb axial tension force where stress must not
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!