I'm having trouble finishing up this part of my project.
I supposed have created a multi dimensional array that got 10 random numbers and then treated as they were Fahrenheit then run them though the equation to get 10 other numbers in Celsius so that the output should look something like this
// this is how i initialize the functions in the main
constint ARRAY_SIZE = 10.;
int a[ARRAY_SIZE];
double ma[1][2];
std::cout << "Initializing temperatures...\n";
InitializeTemperatures(ma, ARRAY_SIZE);
std::cout << "Temperatures=";
PrintArray(ma, ARRAY_SIZE);
std :: cout << "\n";
void InitializeTemperatures(double ma[][2], int xSize)
{
// Develop an algorithm that inserts random numbers
// between 1 and 100 into a[i][0]
// hint: use rand()
// These random numbers represent a temperature in Fahrenheit
// Then, store the Celsius equivalents into a[i][1]
int i, j;
for (i=0; i<xSize; i++)
{
for (j=0; j<2; j++)
{
if(j==0) //inserts random numbers
{
ma[i][0]= rand()% 100 +1; // print 1 to 100
}
elseif (j==1)
{
ma[i][1]= (ma[0][0]-32)/1.8;
}
}}
return;
}
void PrintArray(double ma[][2], int xSize)
{
// print the multi-dimensional array using cout
// Each x-y pair should be printed like so: [x, y]
// All pairs should be printed on one line with no spaces
// Example: [x0, y0][x1, y1][x2, y2] ...
int i;
for (i=0; i<xSize; i++)
{
std::cout << "[" << ma[i][0];
std::cout << "," << ma[i][1];
std::cout <<"]";
}
return;
}