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
PLEASE HELP
Anna11 [10]
PLEASE HELP
NASA scientists have determined that the chance a single person would get hit by a piece of falling satellite is one in 3,200. What can you infer based on this probability?



A. Satellites that enter Earth’s atmosphere land mostly in the ocean.


B. NASA does a good job informing people of when satellites will enter the atmosphere.


C. Satellites that enter Earth’s atmosphere land mostly in unpopulated areas.


D. Much of a satellite is destroyed during the process of entering Earth’s atmosphere.
8 0
3 years ago
Read 2 more answers
The future of work is characterised by choose all that apply
PolarNik [594]

Answer:

where are the answer chioces

Explanation:

5 0
3 years ago
A Pelton wheel is supplied with water from a lake at an elevation H above the turbine. The penstock that supplies the water to t
gayaneshka [121]

Answer:

Following are the proving to this question:

Explanation:

\frac{D_1}{D} = \frac{1}{(2f(\frac{l}{D}))^{\frac{1}{4}}}

using the energy equation for entry and exit value :

\to \frac{p_o}{y} +\frac{V^{2}_{o}}{2g}+Z_0  = \frac{p_1}{y} +\frac{V^{2}_{1}}{2g}+Z_1+ f \frac{l}{D}\frac{V^{2}}{2g}

where

\to p_0=p_1=0\\\\\to Z_0=Z_1=H\\\\\to v_0=0\\\\AV =A_1V_1 \\\\\to V=(\frac{D_1}{D})^2 V_1\\\\\to V^2=(\frac{D_1}{D})^4 V^{2}_{1}

         = (\frac{1}{(2f (\frac{l}{D} ))^{\frac{1}{4}}})^4\  V^{2}_{1}\\\\

         = \frac{1}{(2f (\frac{l}{D})  )} \  V^{2}_{1}\\

\to \frac{p_o}{y} +\frac{V^{2}_{o}}{2g}+Z_0  =\frac{p_1}{y} +\frac{V^{2}_{1}}{2g}+Z_1+ f \frac{l}{D}\frac{V^{2}}{2g} \\\\

\to 0+0+Z_0 = 0  +\frac{V^{2}_{1} }{2g} +Z_1+ f \frac{l}{D} \frac{\frac{1}{(2f(\frac{l}{D}))}\ V^{2}_{1}}{2g}   \\\\\to Z_0 -Z_1 = +\frac{V^{2}_{1}}{2g} \ (1+f\frac{l}{D}\frac{1}{(2f(\frac{l}{D}) )} )  \\\\\to H= \frac{V^{2}_{1}}{2g} (\frac{3}{2}) \\\\\to  \frac{V^{2}_{1}}{2g} = H(\frac{3}{2})

L.H.S = R.H.S

7 0
3 years ago
You are using a Jupyter Notebook to explore data in a DataFrame named productDF. You want to write some inline SQL by using the
defon
You need to explain it more simple as everyone is clueless
7 0
2 years ago
What are the two reasons for a clear cut
Inessa [10]

Answer:

to clear land for agriculture and settlement and to use or sell timber for lumber, paper products, or fuel.

3 0
3 years ago
Other questions:
  • Which type of door consists of thin pieces of wood, glass, or louvers placed within a framed rectangular area?
    7·2 answers
  • I need help!!! Because this is due
    14·2 answers
  • Who tryna play fortnite with me
    11·2 answers
  • A piston having a diameter of 5.48 inches and a length of 9.50 in slides downward with a
    13·1 answer
  • Fluid originally flows through a tube at a rate of 100 cm^3/s. To illustrate the sensitivity of the Poiseuille flow rate to vari
    7·1 answer
  • Pipe (2) is supported by a pin at bracket C and by tie rod (1). The structure supports a load P at pin B. Tie rod (1) has a diam
    15·1 answer
  • Dalton needs to prepare a close-out report for his project. Which part of the close-out report would describe
    6·1 answer
  • Click this link to view O*NET’s Work Context section for Loading Machine Operators. Note that common contexts are listed toward
    10·1 answer
  • A lightbulb has a fixed negative and positive connector. You cannot swap positive and negative sides of a lightbulb in a circuit
    9·2 answers
  • A 20cm-long rod with a diameter of 0.250 cm is loaded with a 5000 N weight. If the diameter of the bar is 0.490 at this load, de
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!