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
Nataly_w [17]
3 years ago
14

.3.3: Populating a vector with a for loop. Write a for loop to populate vector userGuesses with NUM_GUESSES integers. Read integ

ers using cin. Ex: If NUM_GUESSES is 3 and user enters 9 5 2, then userGuesses is {9, 5, 2}
Physics
1 answer:
Reptile [31]3 years ago
8 0

Answer:

#include <iostream>

#include <vector>

using namespace std;

int main() {

  const int NUM_GUESSES = 3;

  vector<int> userGuesses(NUM_GUESSES);

  int i = 0;

int uGuess = 0;

for(i = 0; i <= userGuesses.size() - 1; i++){

 cin >> uGuess;

 userGuesses.at(i) = uGuess;

}

cout << endl;

  return 0;

}

Explanation:

First inbuilt library were imported. Then inside the main( ) function, 3 was assigned to NUM_GUESSES meaning the user is to guess 3 numbers. Next, a vector was defined with a size of NUM_GUESSES.

Then a for-loop is use to receive user guess via cin and each guess is assigned to the vector.

You might be interested in
The application of force over distance is known as
rodikova [14]
The application of force over distance is known as [WORK]
6 0
3 years ago
A fixed coil of wire with 10 turns and an area of 0.055 m2 is placed in a perpendicular magnetic field. This field oscillates in
Blababa [14]

Answer:

Part a)

Average EMF for half cycle is

E_{avg} = 2.64 V

Part b)

For one complete cycle we will have

E_{avg} = 0

Part c)

Maximum induced EMF will be at

t = 0.025 s and 0.075 s

minimum induced EMF is at

t = 0.05s and 0.1 s

Explanation:

As we know that magnetic field is oscillating in direction as well as magnitude

so induced EMF is given as

E = NBA\omega sin(\omega t)

Part a)

For average value of EMF from positive maximum to negative maximum which is equal to half cycle

so we have

E_{avg} = NBA\omega \frac{2}{T}\int_0^{T/2} sin(\omega t) dt

E_{avg} = \frac{2NBA\omega}{\pi}

E_{avg} = \frac{2(10)(0.12)(0.055)(2\pi (10))}{\pi}

E_{avg} = 2.64 V

Part b)

For one complete cycle we will have

E_{avg} = NBA\omega \frac{1}{T}\int_0^T sin(\omega t) dt

E_{avg} = 0

Part c)

Maximum induced EMF will be at

t = \frac{T}{4} and \frac{3T}{4}

here we know

T = \frac{1}{f} = 0.1 s

t = 0.025 s and 0.075 s

minimum induced EMF is at

t = \frac{T}{2} and T

so it is

t = 0.05s and 0.1 s

8 0
3 years ago
Two narrow, parallel slits separated by 0.85 mm are illuminated by 600 nm light, and the viewing screen is 2.8 m away from the s
AURORKA [14]

Answer:

Phase difference = pi/4 radians

Explanation:

Given:

- The wavelength of incident light λ = 600 nm

- The split separation d = 0.85 mm

- Distance of screen from split plane L = 2.8 m

Find:

What is the phase difference between the two interfering waves on a screen, at a point 2.5 mm from the central bright fringe?

Solution:

- The phase difference can be evaluated by determining the type of interference that occurs at point y = 2.5 mm above central order. We will use the derived results from Young's double slit experiment.

                                  sin ( Q ) = m*λ /d  

                                  m = d*sin(Q) / λ

- Where, m is the order number and angle Q is the angle for mth order of fringe from central bright fringe.

                                  r = sqrt ( L^2 + 0.0025^ )

Where, r is the distance from split to the interference bright fringe.

                                  r = sqrt(2.8^ + 0.0025^) = 2.8

                                  sin(Q) = 0.0025 / 2.8

Hence.                        m = 0.00085*0.0025 / 2.8*(600*10^-9)

                                   m = 1.26

- We know that constructive interference would occurred at m = 1 and destructive interference @ m = 1.5. They have a phase difference of pi/2 radians.

- The order number lies in between constructive and destructive interference i.e m ≈ 1.25 then the corresponding phase difference = 0.5*(pi/2).

Answer:                  Phase difference = pi/4 radians

6 0
3 years ago
What element exists in almost every compound in your body and other living things
Aleks [24]
Carbon is one of the main building blocks of life. This is what carbon dating is so effective, because scientists are able to tell the approximate age of something that was once alive given how much carbon is still in the animal. 
<span />
3 0
3 years ago
A race car drives one lap around a race track that is 500 meters in length.
pychu [463]

Explanation:

Check out the picture I drew for a minute before reading this...

B. Distance [the red line] is a scalar quantity reflecting how far an object has traveled. Displacement [the green line] is a vector quantity reflecting how far an object has moved from a point. The key difference is that distance can be any sort of path while displacement is always a vector (or a straight line) between a starting point and a finishing point. Sometimes distance and displacement are equal to one another. Sometimes you have a distance traveled, but zero displacement overall; which is what's going on in your question.

A. The distance that the racecar traveled is indeed 500m. But at the end of the lap, it is right back where it started. So overall, it has been displaced 0m.

3 0
2 years ago
Other questions:
  • What is heat, and how does it affect the molecules<br> in a substance?
    8·1 answer
  • As light waves enter the eye, which three structures do they pass through first?
    15·1 answer
  • A 150-loop coil of cross sectional area 6.3 cm2 lies in the plane of the page. An external magnetic field of 0.060 T is directed
    14·1 answer
  • Two wires are parallel and one is directly above the other. Each has a length of 50.0 m and a mass per unit length of 0.020 kg/m
    11·2 answers
  • Suppose the Earth's magnetic field at the equator has magnitude 0.50×10−4T and a northerly direction at all points. Part A Estim
    12·1 answer
  • A wire carries 3.7 A of current. A second wire is placed parallel to the first 8.0 cm away. What is the current flowing through
    7·1 answer
  • A motorbike is travelling with a velocity of 3m/s. It accelerates at a rate of 9.3m/s for 1.8s.
    10·1 answer
  • A laser (electromagnetic wave) has the maximum electric field strength of 1.0x1011 V/m. What is the force the laser applies on a
    12·1 answer
  • I WILL MARK BRAINLIEST!
    6·1 answer
  • If anyone could answer my question , please help -,- xD
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!