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
ch4aika [34]
4 years ago
7

.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:
Ipatiy [6.2K]4 years ago
3 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 energy transferred between objects that are at different temperatures
sukhopar [10]

Answer:

We learned in the previous section that temperature is proportional to the average kinetic energy of atoms and molecules in a substance, and that the average internal kinetic energy of a substance is higher when the substance’s temperature is higher.

If two objects at different temperatures are brought in contact with each other, energy is transferred from the hotter object (that is, the object with the greater temperature) to the colder (lower temperature) object, until both objects are at the same temperature. There is no net heat transfer once the temperatures are equal because the amount of heat transferred from one object to the other is the same as the amount of heat returned. One of the major effects of heat transfer is temperature change: Heating increases the temperature while cooling decreases it. Experiments show that the heat transferred to or from a substance depends on three factors—the change in the substance’s temperature, the mass of the substance, and certain physical properties related to the phase of the substance.

The equation for heat transfer Q is

Q = mcΔT,

Explanation:

pls brainliest

7 0
2 years ago
If the pressure of a gas is increased, then the volume will decre
pogonyaev

Answer:

The answer is b

Explanation:

8 0
3 years ago
If a rock is dropped from the top of a tower at the front of it and takes 3.6 seconds to hit the ground. Calculate the final vel
expeople1 [14]

Answer:

35.28m/s; 63.50m

Explanation:

<u>Given the following data;</u>

Time, t = 3.6 secs

Since it's a free fall, acceleration due to gravity = 9.8m/s²

Initial velocity, u = 0

To find the final velocity, we would use the first equation of motion;

V = u + at

Substituting into the equation, we have;

V = 0 + 9.8 * 3.6

V = 35.28m/s

Therefore, the final velocity of the penny is 35.28m/s.

To find the height, we would use the second equation of motion;

S = ut + \frac {1}{2}at^{2}

Substituting the values into the equation;

S = 0(3.6) + \frac {1}{2}*9.8*(3.6)^{2}

S = 0 + 4.9*12.86

S = 0.5 *36

S = 63.50m

Therefore, the height of the tower is 63.50m.

6 0
3 years ago
Part A.)Six boxes held at rest against identical walls.
krok68 [10]

Answer:

Explanation:

When a body is held against a vertical wall , to keep them in balanced position , normal force is applied on their surface . this force creates normal reaction which acts against the normal force and it is equal to the normal force as per newton's third law . Ultimately friction force is created which is proportional to normal force and it acts in vertically upward direction . It prevents the body from falling down .

Hence normal force = reaction force .

From second law also net force is zero , so if  normal force is N and reaction force is R

R - N = mass x acceleration = mass x 0 = 0

R = N .

Ranking normal force from  highest  to smallest

150 N , 130 N , 120 N

B )

Frictional force is equal to the weight of the body because the body is held at rest .

Ranking of frictional force form largest to smallest

7 kg , 5 kg , 3 kg , 1 kg .

Here frictional force is irrespective of the normal force acting on the body  because frictional force adjusts itself so that it becomes equal to weight in all cases here because it always balances the weight of the body .

6 0
4 years ago
You and a highway patrolman are driving at constant speeds in opposite directions on a straight highway. The patrolman is drivin
kompoz [17]

Answer:  75 mph

Explanation:

The Relative Speed for a mobile is equal to the diference between the object and the observer:

Relative Speed (Rs) = Object's Velocity  - Observer's Velocity

Thinking on those terms, we would need to have a universal observer to do any understandable measurement on daily basics. This is why we all use earth as a Static Observer for every measurement we do everyday.

Using Earth as an observer, the Velocity for the Patrolman is:

Patrolman Velocity (Vp) = 60 mph

Because the radar gun does measure the Relative Speed for the object, which is 135 mph, we need to work with the equation to find the Velocity using Earth as a reference.

Object's Relative Velocity = Object's Velocity - Patrolman's Velocity

Object's Velocity = Object's Relative Velocity + Patrolman's Velocity

We need to keep in mind, the Patrolman is going on the opposite direction. Because of this the sign for his velocity should be negative.

Object's Velocity = 135 mph + ( -60 mph)

Object's Velocity = 135 mph - 60 mph

Object's Velocity = 75 mph

3 0
3 years ago
Other questions:
  • HELP ASAP. WILL GIVE BRAINLIEST.
    14·1 answer
  • You decide you want to carry a boulder home from the beach it is 30 centimeter on each side. It is made of granite, which has a
    5·1 answer
  • A ball is thrown upward from the ground with an initial speed speed of 25 meters/second; at the same instant, a ball is dropped
    8·1 answer
  • A physics student shoves a 0.50-kg block from the bottom of a frictionless 30.0° inclined plane. The student performs 4.0 j of w
    8·1 answer
  • When light falls on objects, it interacts with them in different ways as shown in the images. What type of interaction is seen i
    11·1 answer
  • Why do boys like boys
    10·1 answer
  • How do objects at rest and in motion respond in the presence of an external, unbalanced force?
    13·1 answer
  • A closed loop conductor that forms a circle with a radius of 2.0 m is located in a uniform but changing magnetic field. If the m
    12·1 answer
  • Can yall help me please?? I can't get it wrong!
    15·2 answers
  • Assume your mass is 84 kg. The acceleration due to gravity is 9.8 m/s 2 . How much work against gravity do you do when you climb
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!