I am having trouble writing this program for temperatureconversion. I have writt
ID: 3615820 • Letter: I
Question
I am having trouble writing this program for temperatureconversion. I have written down the problem and what I have so far.Any help will be greatly appreciated.
Write a program that allows the user to enter 5 Fahrenheittemperatures and converts these 5 temperatures to Celsiustemperatures. Output a table of the Fahrenheit and Celsiustemperatures. Include headings for the table. Use onearray to store the Fahrenheit temperatures and another array tostore the Celsius temperatures.
#include <iostream>
#include <cmath>
using namespace std;
double
convert(double celsius){
double fahrenheit = ((9.0/5.0) * celsius) + 32;
return fahrenheit;
};
int main()
{
int counter = 0;
int flag = 1;
int myarray[5];
while(flag==1&&counter<50)
{
cout << "Enter Temperature Reading:";
cin>>myarray[counter];
counter++;
cout << " Enter 1 to input more values, 0 tostop";
cin >>flag;
}
return 0;
system ("pause");
}