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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
#include <iostream>
using namespace std;
int prodedure(int number_days_of_months[], int days_month, int days[], int size_days, int months[], int months_size);
void display(int months[], int months_size, int days[],int days_size);
int main()
{
int months[10]; //stores the month enter by the user
int days[10]; //stores the days enter by the user
int number_days_of_months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; //representing each of the 12 months of the year
prodedure(number_days_of_months, 12, days, 10, months, 10);
display(months, 10, days, 10 );
return 0;
}
int prodedure(int number_days_of_months[], int days_month, int days[], int size_days, int months[], int months_size)
{
//bool isGameRunning = true;
for (int i = 0; i < 10; i++)
{
cout << "Enter dates in mm/dd format Example 5 31 (end by entering 0 for month):" << endl;
cin >> months[i] >> days[i];
while (months[i] > 12)
{
cout << "enter a valid month" << endl;
cin >> months[i];
}
if (months[i]==0)
{
cout << "month is 0 it should had exit";
break;
}
}
return 0;
}
| |