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
balls a, with a mass of 20 kg, is moving to the right at 20 m/s. At what velocity should Ball B, with a mass of 40 kg, move so t
Leya [2.2K]
In that case, their momentum must be equal. 
So, m1v1 = m2v2
20 * 20 = 40 * v2
v2 = 400 / 40
v2 = 10

In short, Your Answer would be: 10 m/s

Hope this helps!
3 0
3 years ago
A mover loads a crate onto a truck bed 1.6m from the street using a ramp that is 4.6m long. What is a mechanical advantage?
Ne4ueva [31]

Answer:

Mechanical advantage = 2.875

Explanation:

Given:

A diagram is shown below for the above scenario.

Length of ramp (Effort arm) = 4.6 m

Height of truck bed ( Resistance length) = 1.6 m

Mechanical advantage (MA) is the ratio of effort arm and resistance length.

So, mechanical advantage is given as,

MA=\frac{\textrm{Effort arm}}{\textrm{Resistance length}}= \frac{4.6}{1.6}=2.875

6 0
3 years ago
2 Points
Mademuasel [1]

According to Newton's Second Law of Motion :

The Force acting on an Object is equal to Product of Mass of the Object and Acceleration produced due to the Force.

:\implies  Force acting = Mass of the Object × Acceleration

Given : Force = 50 newton and Mass of the Object = 10 kg

Substituting the respective values in the Formula, we get :

:\implies  50 N = 10 kg × Acceleration

:\implies \mathsf{Acceleration = \dfrac{50\;N}{10\;kg}}

:\implies Acceleration of the Object = 5 m/s²

4 0
3 years ago
What radiation do remote controls use?
aleksandr82 [10.1K]

Answer:infrared radiation

Explanation:

Most remote control uses infrared radiation

5 0
3 years ago
Examine the cross-sectional slice of a stem of a mint plant. Which statement most specifically describes mint?
Maslowich

The available options are:

Mint is a dicot.

Mint is a monocot.

Mint is an angiosperm.

Mint is a bulb plant.

Answer:

Mint is a dicot.

Explanation:

Given the fact that Mint is considered to be a member of Lamiaceae, an angiosperm plant which is characterized by typically having leaves that consist of reticulate vacation and appears like veins in structure. It also has a seed that contains two cotyledons.

Hence, it is considered a DICOT PLANT due to these characteristics. The botanical name of Mint is referred to as Mentha arvensis.

7 0
2 years ago
Other questions:
  • An archerfish, peering from just below the water surface, sees a grasshopper standing on a tree branch that's just above the wat
    9·1 answer
  • A student pushes a box with a total mass of 50 kg. What is the net force on the box
    11·1 answer
  • A migrating bird flew across a lake at an average speed of 18 meters per second. Was the distance that the bird flew across the
    7·1 answer
  • Which of the following hypotheses is both falsifiable and testable?
    9·2 answers
  • A horizontal force, F1 = 65 N, and a force, F2 = 12.4 N acting at an angle of θ to the horizontal, are applied to a block of mas
    12·1 answer
  • Chromium has the electron configuration 4s1 3d5 beyond Argon. What are the L and S values?
    8·1 answer
  • Read over slides 1-7 to see definitions and map examples of each physical feature.
    8·1 answer
  • Table B:Convection (Cold Water) Time (minutes : seconds) Food Coloring Movement 0:30 1:00 1:30 2:00 2:30 3:00
    15·1 answer
  • Can you please help me on all of these!!!! Please
    6·1 answer
  • Hello, I am so confused about this problem, could you help ?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!