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
|
int idx = 0;
char ans = 'y';
string month[13] = { "", "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" };
string flower[13] = { "", "carnation", "iris", "daffodil", "daisy", "lily of the valley", "rose", "sunflower", "gladiolus", "aster", "snapdragon", "chrysanthemum", "orchid" };
while (ans == 'y' || ans == 'Y')
{
system("cls");
system("color f0");
cout << "\t\t\t******************************" << endl;
cout << "\t\t\t* First Last *" << endl;
cout << "\t\t\t* computer *" << endl;
cout << "\t\t\t* Flower *" << endl;
cout << "\t\t\t******************************" << endl << endl;
cout << "Please enter the month you were born <1-12>: ";
cin >> idx;
while (idx<0 || idx>13)
{
cout << "invalid number entered: " << endl;
cout << "Please enter the month you were born <1-12>: ";
cin >> idx;
}
cout << "you were born on " << month[idx] << " and your flower is " << flower[idx] << endl;
cout << "\nwould you like to continue <Y or N>? ";
cin >> ans;
}
cout << endl << " THANK YOU" << endl << endl;
system("pause");
return 0;
|