Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
998 B
0
Indexable
Never
#include <stdio.h>

int menu() {

    int opt = 0;

    printf("Hello! Welcome to the Medicina's menu!\n");
    printf("\t1 - Add a new patient\n");
    printf("\t2 - Remove a patient\n");
    printf("\t3 - Show all patients\n");
    printf("\t4 - Exit\n");

    printf("\nChoose an option: ");
    scanf("%d", &opt);

    return opt;
}

int main() {

    int opt = 0;

    do {

        opt = menu();

        switch(opt) {
            case 1:
                //addPatient();
                printf("Add patient\n");
                break;
            case 2:
                //removePatient();
                printf("Remove patient\n");
                break;
            case 3:
                //showPatients();
                printf("Show patients\n");
                break;
            case 4:
                printf("Bye!\n");
                break;
            default:
                printf("Invalid option!\n");
                break;
        }

    }while(opt != 4);

    return 0;
}