Make a copy of the pthreads_skeleton.cpp program and name it pthreads_p2.cpp Modify the main function to implement a loop that reads 10 integers from the console (user input) and stores these numbers in a one-dimensional (1D) array (this code will go right after the comment that says ""Add code to perform any needed initialization or to process user input""). You should use a global array for this.

Answers

Answer 1
Answer:

Answer:

The solution code is as follows:

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    int myArray [10] = {};
  6.    
  7.    int i;
  8.    for( i = 0; i < 10; i++ )
  9.    {
  10.        cout <<"Enter an integer: ";
  11.        cin>> myArray[i];
  12.    }
  13. }

Explanation:

Firstly, we initialize a 10-elements array, myArray (Line 7) with no values.

Next, we create a for-loop (Line 10). Within the loop, we prompt user to enter an integer and assign the input value to the current element of myArray (Line 12-13).


Related Questions

A cylindrical specimen of cold-worked steel has a Brinell hardness of 250.(a) Estimate its ductility in percent elongation.(b) If the specimen remained cylindrical during deformation and its original radius was 5 mm (0.20 in.), determine its radius after deformation.
A rocket is launched vertically from rest with a constant thrust until the rocket reaches an altitude of 25 m and the thrust ends. The rocket has mass 2 kg and thrust force 35 N. Neglecting air resistance, determine (a) the speed of the rocket when the thrust ends, (b) the maximum height reached by the rocket, and (c) the speed of the rocket when it returns to the ground.
What is a SAFETY CHECK
What character string does the binary ASCII code 1010100 1101000 1101001 1110011 0100000 1101001 1110011 0100000 1000101 1000001 1010011 1011001 0100001?
Why or why not the following materials will make good candidates for the construction of a) Turbine blade for a jet turbine and b) Thermal barrier coating. Cement, aluminum, engineering ceramic, super alloy, steel and glass

Which outcome most accurately portrays the future for the timber company in the following scenario?A timber company that cuts and sells its own wood has been in high demand for the past three years. The company has gone through many acres of forest in its area, but it is sure to plant tree seeds after it bulldozes a section.

The timber company will lose business soon because not many people will need to build houses and buildings anymore.
The timber company will run out of trees quickly because the seedlings will not have enough time to become full-grown timber.
The timber company will go out of business due to the rising number of buildings using cement and concrete rather than timber.
The timber company will continue to grow because of its good business practices, and it will become the number one timber company in the country.

Answers

Answer: The timber company will run out of trees quickly because the seedlings will not have enough time to become full-grown timber

Explanation: I got it right on Edge!!!! Hope this helps

Link AB is to be made of a steel for which the ultimate normal stress is 65 ksi. Determine the cross-sectional area of AB for which the factor of safety will be 3.20. Assume that the link will be adequately reinforced around the pins at A and B.

Answers

Explanation:

ddddjidirjejekejwjwkw

Isothermal process also means adiabatic internal reversible process. a)-True b)-False

Answers

Answer:

(b) False

Explanation:

Isothermal process is a process in which temperature is constant ,heat can be transferred but temperature is constant and as the temperature is constant so internal energy is also constant

In other hand in adiabatic process there no transfer of heat and internal energy also changes

So the given statement is false statement  

Water needs to be turned into steam in a high altitude lab where the atmospheric pressure is 84.6 KPa. Computte the heat energy (in calories) required to evaporate 900g of water at 15 degree C under these conditions.

Answers

Answer:

558.1918 kilocalories = 558191.8 calories

Explanation:

Data provided in the question:

Atmospheric pressure = 84.6 KPa

Mass of water, m = 900 g = 0.90 kg

Temperature = 15°C

Now,

Temperature at 84.6 KPa = 94.77°C

Therefore,

Heat energy required = m(CΔT + L)

here,

C is the specific heat of the water = 4.2 KJ/kg.°C

L = Latent heat of water = 2260 KJ/kg

Thus,

Heat energy required = 0.90[ 4.2 × (94.77 - 15) + 2260 ]

= 2335.53 KJ

also,

1 KJ = 0.239  Kilocalories

Therefore,

2335.53 KJ = 0.239 × 2335.53 Kilocalories

= 558.1918 kilocalories = 558191.8 calories

Define a homogeneous material. O Material has temperature dependent refractive index.O Material exhibits both elastic and plastic behavior. O Material exhibits little or no yielding before failure. O Material has uniform properties throughout.

Answers

Answer:

Option D

Material has uniform properties throughout.

Explanation:

A homogeneous material is a material that exhibits uniform properties throughout and these properties cannot be separated. These materials can be metals, ceramics or alloys that exhibit similar properties throughout. The similar properties may include evaporation point, density and other properties.

A 26-tooth pinion rotating at a uniform 1800 rpm meshes with a 55-tooth gear in a spur gear reducer. Both pinion and gear are manufactured to a quality level of 10. The transmitted tangential load is 22 kN. Conditions are such that Km = 1.7. The teeth are standard 20-degree, full-depth. The module is 5 and the face width 62 mm. Determine the bending stress when the mesh is at the highest point of single tooth contact.

Answers

Answer:

The bending stress of the face tooth is  \sigma _(bg) = 502.82 MPa

Explanation:

From the question we are told that

        The number of tooth of the pinion is  N_t = 26 \ tooth

         The velocity of rotation is given as \omega_p = 1800 rpm

         The number of tooth is of the gear is  N_g = 55 \ tooth

        The quality level is Q_r = 10

          The transmitted tangential load is F_T = 22\ kN = 22 KN * (1000N)/(1KN) = 22*10^3 N

                                                                    k_m = 1.7

        The angle of the teeth is  \theta_t = 20^o

         The module is  M= 5

         The face width is W_f = 62mm

The diameter of the pinion is mathematically represented as

                d_p = M * N_t

Substituting the values

                d_p = 5 *26

                    = 130 mm = (130)/(1000) = 0.130m

The pitch line velocity is mathematically represented as

                     V_t = (d_p )/(2) (2 \pi \omega_p)/(60)

Substituting values

                          = (0.130)/(2) * (2 * 3.142 * 1800 )/(60)

                          = 12.25\  m/s

Generally the dynamic factor is mathematically represented as

                      K_v = [(A)/(A +√(200V_t) ) ]^B

Now B is a constant that is mathematically represented as

                B = ((12 -Q_r )^(2/3))/(4)

substituting values

                  = ((12- 10 )^(2/3))/(4)

                  =0.3968

A is also a constant that is mathematically represented as

              A = 50 + 56(1 -B)

Substituting values

             = 50 +56 (1- 0.3968)

             = 83.779

Substituting these value into the equation for dynamic factor we have

           K_v = [(83.779)/(83.779 + √(200 * 12.25) ) ]^(0.3968)

                = 0.831

The geometric bending factor for a 20° profile from table

"AGMA Bending Geometry Factor J for 20°, Full -Depth Teeth with HPSTC Loading , Table 2-9"                

That corresponds to 55 tooth gear meshing with 26 pinion is

                   J_g = 0.41

the diameter pitch can be mathematically represented as

              p_d = (1)/(M)

Substituting values

            p_d  = (1)/(5)

                =0.2mm^(-1)

The mathematically representation for gear tooth bending stress in the teeth face is as follows

          \sigma_(bg) = (F_T \cdot p_d )/(W_f * J_g)(K_a K_(dt) )/(K_v) K_s K_B K_t ----(1)

Where W_t is the tangential load

            W_f is the face width

            K_a is the application factor  this is obtained from table "Application Factors, Table 12-17 " and the value  is  K_a  = 1

            K_(dt) is the load distributed factor

            K_s is the size factor

             K_B is the rim thickness factor which is obtained for M which has a value  1

           K_t is the idler

Substituting values into equation 1

     \sigma_(bg) = (22*10^3 *0.2)/(62 * 0.41) * (1 * 1.7 )/(0.831)  * 1 *1 *1.42

            = 502.82  N/mm^2

            = 502.82 * 1000 * (N)/(m^2)

           = 502.82 MPa