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.
It is itself. This question does not make sense.
Given that:
Energy of bulb (Work ) = 30 J,
Time (t) = 3 sec
The power consumption = ?
We know that, Power can be defined as rate of doing work
Power (P) = Work(Energy supplied) ÷ time
= 30 ÷ 3
= 10 Watts
<em> The power consumption is 10 W.</em>
Work is force times distance. If there's no distance, there's no work being done.