1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
// sample code
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char** argv) {
// variable declaration section
const int ARRAY_SIZE = 7;
string dayName[ARRAY_SIZE] = { "Mon", "Tue", "Wed", "Thur","Fri", "Sat", "Sun" };
float dayTEMP[ARRAY_SIZE] = {65, 72, 44, 45, 66, 88, 99};
//celsius array
string dayNamei[ARRAY_SIZE] = { "Mon", "Tue", "Wed", "Thur","Fri", "Sat", "Sun" };
float dayTEMPi[ARRAY_SIZE] = {65, 72, 44, 45, 66, 88, 99};
// temp table
for (int arrayIndex = 0; arrayIndex < ARRAY_SIZE; arrayIndex++)
{
cout << dayName[arrayIndex] << " Fahrenheit: "<< dayTEMP[arrayIndex] << endl;
cout << dayNamei[arrayIndex] << " Celsisus: " << dayTEMPi[arrayIndex] << endl;
}
return 0;
}
|