i am doing a class in Problem Solving with C++ and am having difficulty with a problem. I have written the code but it is not building. I am using Microsoft Visual Studio. Please see the question and the code I have written:
The next assignment is:
Develop a solution that will caluculate the average temperature, given a set of temperatures. The number of temperatures may differ from time to time. (Use a trip value to stop the procession of the loop.) Test the solution with the following 10 temperatures:
78*
85*
87*
75*
56*
90*
80*
83*
90*
70*
Code
#include <iostream>
using namespace std;
void main()
{
int numberOftotalTemp=0;
int sum=0;
float average=0;
int Temp=0;
cout<< "Enter number of total temps";
cin>> numberOftotalTemp;
When i try to build it in the compiler the dos screen appears where I can enter the necessary info but when I enter the last temperature it closes the screen down...