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
Over [174]
3 years ago
5

Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to

print two random integers between (and including) 0 and 9. End with a newline. Ex: 5 7 Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, after calling srand() once, do not call srand() again. (Notes)

Engineering
1 answer:
liq [111]3 years ago
4 0

Answer:

View Image

Explanation:

No number is really ever random. It all has a seed, which is an initial value for the 'random' number to be generated. The rand() function uses an equation to  generate its value, and all its 'random' value depend on the first number you plug in into your equation. The initial number you plug into your equation is what srand() do.

If you just call rand() alone without calling srand() then the generated numbers will automatically use srand(1) as a default seed. Using the same srand() value will always yield the same sequence of numbers.

To get a number between 0 and 9, take the modulus of it with 10 because modulus give you the remainder, so the number rand()%10 will never be equal to 10 or greater.

You might be interested in
What are example for mantle
xenn [34]

The definition of a mantle is a shawl or a cloak. An example of a mantle is a fancy shawl worn over a cocktail dress.

3 0
3 years ago
An elastic cable is to be designed for bungee jumping from a tower 130 ft high. The specifications call for the cable to be 85 f
azamat

Answer:

<em>a) The spring constant is 50 lb/ft</em>

<em>b) The man is 26.3 ft close to the ground.</em>

<em></em>

Explanation:

Height of tower is 130 ft

Specification calls for a cable of length 85 ft

the maximum this length stretches is 100 ft when subjected to a load of 750 lb

The extension of the cable is calculated from the formula from Hooke's law

F = kx

where F is the load or force on the cable

k is the spring constant of the cable

x is the extension on the cable

a) The extension on the cable is

x = 100 ft - 85 ft = 15 ft

substituting into the formula above, we'll have

750 = k*15

k = 750/15 = <em>50 lb/ft</em>

b) for a 185 lb man, jumping down will give an extension gotten as

F = kx

185 = 50*x

x = 185/50 = 3.7 ft

The total length of the cable will be extended to 100 ft + 3.7 ft = 103.7 ft

closeness to the ground = 130 ft - 103.7 ft =<em> 26.3 ft</em>

3 0
3 years ago
Multi media common work context for reporters correspondents
GuDViN [60]

Answer:

I dont know sorry i in a hurry and i need points so vary sorry

Explanation:

my assistant is due at 9:00 today . Not that you care but

6 0
3 years ago
What is the difference between a discrete and continuous system?
Serjik [45]

Answer:Discrete system are those system which change the state at the discrete point of time and continuous system are those which have state change at continuous period of time.

Explanation:

  • The major difference between discrete and continuous system is that, discrete system has state change over a discontinuous time period whereas the change of state in continuous system is over a continuous time period .
  • Variations can be found in the discrete system signal but  in continuous system variation cannot be found input and output signal.
  • Example:-

       Discrete system:-employees reporting at office at different time like

       9:10am, 9:15am etc              

       <u> Continuous system</u>:-the water flow over a dam in particular quantity                    

7 0
3 years ago
At a ski resort, water at 40 °F is pumped through a 3-in.-diameter, 2001-ft-long steel pipe from a pond at an elevation of 4286
deff fn [24]

Answer:

P = 24.38 hp

Explanation:

Given data:

diameter of steel pipe = 3 inc

length of pipe = 2001 ft

elevation of pond = 4286 ft

elevation of snow making machine = 4620 ft

Rate of water = 0.26 ft^3/s

Applying bernouli equation on bioth side

\frac{P}{\rho} + \frac{v_1^2}{2g} + z_1 + h_p =\frac{P_2}{\rho} + \frac{v_2^2}{2g} + z_2 + \frac{flv^2}{2gD}.....1

where P_2 = 182 psi

P_1 = 0, v_1 = 0

V =V_2 = \frac{Q}{\frac{\pi}{4} D^2}= \frac{0.26}{\frac{\pi}{4} \times (3/12)^2} = 5.30 ft/s

calculation fro friction factor

from standard table we have

\frac{\epsilon}{D} = \frac{0.00015}{(3/12)} = 6\times 10^{-4}

Re =\frac{VD}[\nu} = \frac{5.30 \times (3/12)}{1.66 \times 10^{-5}} = 7.96 \times 10^4

so for calculated R and\frac{\epsilon}{D}, F value = 0.0212

from equation 1

h_p = \frac{P_2}{\rho} + Z_2 -Z_1 +(1 + f\frac{l}{D}) \frac{V^2}{2g}

h_p = \frac{182 \times 144/ lb /ft^2}{62.4} + 4620 - 4286 + (1 + 0.0212 \frac{2001}{(3/12)}) \frac{5.30}{2\times 32.2}

h_p = 826.76ft so that

P =  \rho Q h_p = 62.4 \times 0.26 \times 826.76 = 13413.38 ft lb/s = 24.38 hp

3 0
3 years ago
Other questions:
  • Derive the probability that a receptor is occupied by a ligand using a model that treats the L ligands in solution as distinguis
    12·1 answer
  • What are the two types of pumps in compressors?
    5·2 answers
  • A three-phase, 480 Volt, 120 horsepower, 50 Hertz four-pole induction motor delivers rated output power at a slip of 4%. Determi
    12·2 answers
  • For a 68 wt% Zn-32 wt% Cu alloy, make schematic sketches of the microstructure that would be observed for conditions of very slo
    14·1 answer
  • A horizontal channel of height H has two fluids of different viscosities and densities flowing because of a pressure gradient dp
    5·1 answer
  • A 2-mm-diameter electrical wire is insulated by a 2-mm-thick rubberized sheath (k = 0.13 W/m ? K), and the wire/sheath interface
    5·1 answer
  • What is the average speed of a car that travels 80km in 1.5 hours
    12·2 answers
  • State and explain briefly four (4) functions that a machine foundation should fulfill.
    11·1 answer
  • What gives thrill in a roller coaster? High speed or Changing acceleration? Explain your answer.
    12·1 answer
  • If I have a scaffold that is 83' tall, and the base of my scaffold is 5' wide least base dimension, then I am allowed to space m
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!