示例#1
0
int main()
{
  Year year;
  int choice;
  short month, day;
  char s[80];
  year.read();
  choice = getChoice();

  while(choice != 0)
  {
    if(choice == 1)
    {
      getDate(month, day);
      year.searchDate(month, day);
    }
    else // choice == 2
    {
      getSubject(s);
      year.searchSubject(s);
    }

    choice = getChoice();
  } // while choice not Done

  return 0;
} // main()
示例#2
0
int main()
{
  Year year;
  int choice;
  short month, day;
  char s[80];
  year.read();
  choice = getChoice();

  while(choice != 0)
  {
    switch (choice)
    {
      case 1: 
      {
        getDate(month, day);
        year.searchDate(month, day);
        break;
      }
      case 2:
      {
        getSubject(s);
        year.searchSubject(s);
        break;
      }
      case 3:
      {
        getDate(month, day);
        addAppointment(year, month, day);
        break;
      }
    }
    choice = getChoice();
  } // while choice not Done

  return 0;
} // main()