Write a C++ program that reads an unspecified number of temperatures in Celcius
ID: 652099 • Letter: W
Question
Write a C++ program that reads an unspecified number of temperatures in Celcius from the keyboard (prompt the user to enter them one at a time). The values should be added to a vector using the vector class with the push_back function. Instruct the user to enter an invalid temperature (<-273) to indicate that they are done entering values. Use functions and algorithms in the <algorithm> and <numeric> libraries to find the max, min, sum, and count (number of values) and display the results. Also sort the temperatures in increasing order and display the values.
Explanation / Answer
#include <vector>
using namespace std;
int main(){
vector<float> temperature;
float sum;
cout<<
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.