1.
Suppose you are collecting data for a science experiment. You are to perform three trials of eight temperature readings measured in degrees fahrenheit to the nearest hundredth and initialized to freezing. Choose the vector that has the proper amount of storage for this scenario.
vector<int> temps (24, 32.00);
- We can’t declare the vector as an integer type because all temperature readings will be truncated.
vector<double> temps (24, 32.00);
- First comes the vector size, then the initial values.
vector<double> temps (0.00, 24);
- Freezing is 32 degrees fahrenheit. The order of parameters is incorrect.
vector<double> temps (32, 24.00);
- This statement creates a vector size 32 with elements initialized to 24.00 degress fahrenheit.