- #1
ineedhelpnow
- 651
- 0
ok I am working on some activities and i can't get past this one.
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}.
Sample program:
this is all i got so far
now I am stuck (Blush). do i need to define any new variables? (Thinking) like "x" or something. a variable for the integers entered?
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}.
Sample program:
Code:
#include <iostream>
#include <vector>
using namespace std;
int main() {
const int NUM_GUESSES = 3;
vector<int> userGuesses(NUM_GUESSES);
int i = 0;
<STUDENT CODE>
return 0;
}
this is all i got so far
Code:
for(i=0;i<NUM_GUESSES;++i)
now I am stuck (Blush). do i need to define any new variables? (Thinking) like "x" or something. a variable for the integers entered?