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
The pressure distribution over a section of a two-dimensional wing at 4 degrees of incidence may be approximated as follows: Upp
Aliun [14]

Answer:

The lift coefficient is 0.3192 while that of the moment about the leading edge is-0.1306.

Explanation:

The Upper Surface Cp is given as

Cp_u=-0.8 *0.6 +0.1 \int\limits^1_{0.6} \, dx =-0.8*0.6+0.4*0.1

The Lower Surface Cp is given as

Cp_l=-0.4 *0.6 +0.1 \int\limits^1_{0.6} \, dx =-0.4*0.6+0.4*0.1

The difference of the Cp over the airfoil is given as

\Delta Cp=Cp_l-Cp_u\\\Delta Cp=-0.4*0.6+0.4*0.1-(-0.8*0.6-0.4*0.1)\\\Delta Cp=-0.4*0.6+0.4*0.1+0.8*0.6+0.4*0.1\\\Delta Cp=0.4*0.6+0.4*0.2\\\Delta Cp=0.32

Now the Lift Coefficient is given as

C_L=\Delta C_p cos(\alpha_i)\\C_L=0.32\times cos(4*\frac{\pi}{180})\\C_L=0.3192

Now the coefficient of moment about the leading edge is given as

C_M=-0.3*0.4*0.6-(0.6+\dfrac{0.4}{3})*0.2*0.4\\C_M=-0.1306

So the lift coefficient is 0.3192 while that of the moment about the leading edge is-0.1306.

5 0
3 years ago
An approach to a signalized intersection has a saturation flow rate of 1800 veh/h. At the beginning of an effective red, there a
Tcecarenko [31]

Answer: The total vehicle delay is

39sec/veh

Explanation: we shall define only the values that are important to this question, so that the solution will be very clear for your understanding.

Effective red time (r) = 25sec

Arrival rate (A) = 900veh/h = 0.25veh/sec

Departure rate (D) = 1800veh/h = 0.5veh/sec

STEP1: FIND THE TRAFFIC INTENSITY (p)

p = A ÷ D

p = 0.25 ÷ 0.5 = 0.5

STEP 2: FIND THE TOTAL VEHICLE DELAY AFTER ONE CYCLE

The total vehicle delay is how long it will take a vehicle to wait on the queue, before passing.

Dt = (A × r^2) ÷ 2(1 - p)

Dt = (0.25 × 25^2) ÷ 2(1 - 0.5)

Dt = 156.25 ÷ 4 = 39.0625

Therefore the total vehicle delay after one cycle is;

Dt = 39

4 0
3 years ago
A typical aircraft fuselage structure would be capable of carrying torsion moment. a)True b)- False
Taya2010 [7]

Answer:

True

Explanation:

An aircraft is subject to 3 primary rotations

1) About longitudinal axis known as rolling

2) About lateral axis known as known as pitching

3) About the vertical axis known as yawing

The rolling of the aircraft induces torsion in the body of the aircraft thus the fuselage structure should be capable of carrying torsion

8 0
3 years ago
If you log into the admin account on windows 10, will the admin be notified ? ​
professor190 [17]

Answer:

Just message the Admin,

Ok.

6 0
3 years ago
Read 2 more answers
6) Describe the differences between the troposphere and stratosphere.
vodka [1.7K]

Answer:

frejfru8758u37

Explanation:

i need points

8 0
3 years ago
Other questions:
  • Why should engineers avoid obvious patterns?
    13·2 answers
  • Describe the meaning of the different symbols and abbreviations found on the drawings/documents that they use (such as BS8888, s
    12·1 answer
  • For a rod of annealed AISI 1018 steel with a cross sectional area of 0.65 in^2?; what is the maximum tensile load Pmax that shou
    10·1 answer
  • Traditional password entry schemes are susceptible to "shoulder surfing" in which an attacker watches an unsuspecting user enter
    13·1 answer
  • A proposed piping and pumping system has 20-psig static pressure, and the piping discharges to atmosphere 160 ft above the pump.
    8·1 answer
  • A Barnes and Books is interested in purchasing a two-story building for a new
    5·1 answer
  • A bar of steel has the minimum properties Se = 40 kpsi, S = 60 kpsi, and S-80 kpsi. The bar is subjected to a steady torsional s
    6·1 answer
  • Place these events in chronological order. Put the numbers 1-6 next to the<br> events.
    15·1 answer
  • Implement a program that manages shapes. Implement a class named Shape with a method area() which returns the double value 0.0.
    8·1 answer
  • Why charles babbage is known as father of computer explain <br>​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!