Code:
int main(void)
{
int value=0;
printf("\nChoose from the list of options:\n");
printf("\n1.Calender Options");
printf("\n2.Appointment Options");
printf("\n3.Quit\n\n");
printf("Option: ");
scanf("%d", &value);
switch(value)
{
case 1:
subm_cal();
break;
case 2:
subm_app();
break;
case 3: // This Quits from the menu
break; //
default: // For when they type something not in range of 1-3
printf("\nInvalid Choice\n\n"); //
}
printf("\n\n");
system("pause");
return 0;
}
//////////////////////////////////////////////////////////////////////////
// Sub menus /
//////////////////////////////////////////////////////////////////////////
void subm_cal()
{
int value=0;
printf("\nCalender Menu:\n");
printf("\n1.Monthly Calender");
printf("\n2.Yearly Calender");
printf("\n3.Time Slots");
printf("\n4.Return To Main Menu\n\n");
printf("Option: ");
scanf("%d", &value);
switch(value)
{
case 1:
int n, s;
printf("\n\nEnter number of days in month:"); //
scanf("%d", &n); //
printf("\n\nEnter the day for the first of month:"); // This Area is calling the function to make the calender
scanf("%d", &s); //
makeCalendar(n,s); //
break; //
case 2:
cal_year();
break;
case 3:
printf("Time Slots Here");
break;
case 4:
break;
default: // For when they type something not in range of 1-3
printf("\nInvalid Choice\n\n"); //
}
}
void subm_app()
{
int value=0;
printf("\nAppointments Menu:\n");
printf("\n1.Add Appointment");
printf("\n2.Edit Appointment");
printf("\n3.View / Load Appointments");
printf("\n4.Return To Main Menu\n\n");
printf("Option: ");
scanf("%d", &value);
switch(value)
{
case 1:
appointment();
break;
case 2:
printf("Edit Appointments Here");
break;
case 3:
ld_apps();
break;
case 4:
break;
default: // For when they type something not in range of 1-3
printf("\nInvalid Choice\n\n"); //
}
}
basically, when the switch menu option is choose, like 1, it performs a function, i just want the menu to come back up after they have done the function so they can carry on performing tasks instead of it closing and haviong to reopen it