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
4vir4ik [10]
4 years ago
7

Write a for loop to populate vector userGuesses with NUM_GUESSES integers. Read integers using cin. Ex: If NUM_GUESSES is 3 and

user enters 9 5 2, then userGuesses is {9, 5, 2}.
Computers and Technology
2 answers:
Tanzania [10]4 years ago
8 0
#include <iostream>
#include <vector>

#define NUM_GUESSES 3

int main()
{
  std::vector<int> userGuesses;
  for (int i = 0, input; i < NUM_GUESSES; i++)
  {
    std::cin >> input;
    userGuesses.push_back(input);
  }
}
earnstyle [38]4 years ago
8 0

Answer:

The solution code is written in C++.

  1.    vector<int> userGuesses;
  2.    int NUM_GUESSES = 3;
  3.    
  4.    int i;
  5.    int inputNum;
  6.    
  7.    for(i = 1; i <= NUM_GUESSES; i++){
  8.        cin>>inputNum;
  9.        userGuesses.push_back(inputNum);
  10.    }

Explanation:

By presuming there is a vector, userGuesses and the NUM_GUESSES is 3 (Line 1 - 2).

Next we can create a for-loop that will run for NUM_GUESSES round of iterations. In each iteration, we use cin to get an input number and then use push_back method to add the input number to the userGuesses vector (Line 7 - 10).

You might be interested in
Ifdjgidfpojcjdizchnllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllsssssssssssssssssssssssssss
STatiana [176]

Answer:

HELLO :}

Explanation:

7 0
4 years ago
Read 2 more answers
When you purchase software in a box, reading the ________ is important to know if the software will function properly?
ycow [4]
Minimal and Recommended System Requirements
6 0
3 years ago
Your IT manager wants you to set up three computers to appear to users as one powerful Windows Server 2016 server. What capabili
Marina86 [1]

Answer:

The answer is "Clustering"

Explanation:

Clustering is a technique, which includes the Microsoft Windows and the coordination with an individual multi-PC's, that is mostly connected to the local area network, as a single platform.

  • It is cheaper than one device.
  • It enables you to greater machine performance and increases usability and reliability, that's why the answer to this question is "Clustering".
4 0
3 years ago
Tahir is setting up a message option before sending an e-mail to a colleague. He goes into the Properties dialog box and chooses
Fed [463]

The answer is Sensitivity

Tahir can restrict actions a recipient can take on the messages he sends. It is recommended that you use IRM (Information Rights Management) if available. Choosing the private option will restrict the recipient from taking actions such as forwarding a confidential message to another person. When Tahir selects the private option, the recipient of the message will see a “please treat this as private” in the information bar.

3 0
4 years ago
You work with alot of different documents in your internship with a software development company. What kinds of actions can you
Doss [256]

Answer:

Explanation:

Try as much as possible, to keep like files together in one folder. Even so there if you run into the hundreds or thousands, that is not going to be an easy thing do.

What ever you do, do clutter up your favorites bar, especially if your favorites spill over into where you have to push a button to get to them. Keep that bar open for what you really need on that bar. Mine has Brainly, Kitco, My Alberta Health, A graphing program, a second graphing program, Amazon, a scrabble word finder, and a couple of other things. It

If you can, try and keep your favorites to something that would be useless to anyone else. My favorites are worthless to anyone else. But I play a lot of scrabble related games.

7 0
2 years ago
Other questions:
  • Grace is the sub-editor in a business firm. which feature of a word processing program would she use to make her changes visible
    14·1 answer
  • TO COMPUTING IN BUSINE
    14·1 answer
  • Sizing handles are used in Microsoft® Word® to _____.
    13·1 answer
  • COMPUTER ORGANIZATION &amp; ARCHITECTURE I<br>please help need the correct answers to all
    6·1 answer
  • Moore's Law states that the processing power of the latest computer chips doubles about every eighteen months. Assuming the grap
    6·1 answer
  • Create a Trip class. Include as data members destination, distance traveled, total cost of gasoline, and number of gallons consu
    14·1 answer
  • Formulate it as a tree search problem.
    15·1 answer
  • An alteration threat violates information integrity. <br> a. True <br> b. False
    13·1 answer
  • What are five (5) things about this career choice that appeals to you?
    7·1 answer
  • Your class requires you to use a program you must download on your computer. You have waited until day 5 of the week to download
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!