Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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<<

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote