#include <iostream>
using namespace std;
const int Row = 4;
const int Col = 10;
const char Season[Row][Col] = {"Spring", "Summer", "Fall", "Winter"};
void fill_array(double *, const int);
void show_array(double *, const int);
int main() {
double expense[Row];
fill_array(expense, Row);
show_array(expense, Row);
}
void fill_array(double pE[], const int n) {
int i = 0;
while (i < n) {
cout << "Enter your " << Season[i] << "'s expenses: ";
if (!(cin >> pE[i])) {
cin.clear();
while (cin.get() != '\n')
;
cout << "Invalid value!\n";
continue;
}
i++;
}
}
void show_array(double pE[], const int n) {
for (int i = 0; i < n; i++)
cout << Season[i] << ": " << pE[i] << endl;
}