1. ## Priority Queue Double Linked List

You as a programmer asked to develop an application to distribute the cure, here is thedetails:
1. Application must implement Priority Queue Double Linked List
2. Input total patients and total cure available
3. Input patient data (date of birth and full name) as much as total patients
a. Format: dd mmmm yyyy - Full Name
b. Example: 14 february 1980 - Ronald Rich

4. Push all patient's data to Priority Queue Double Linked List. The older will beprioritized, check the date of birth.
5. Pop/delete data as much as total cure
6. View the result:
a. If there is enough cure for patients show “All patients get the cure, N cure left”
b. Otherwise, show “Need N more cure” and show patient’s data.

7. Pop all data in Priority Queue Double Linked List

Help Me To Completed This Snippet Below :

Code:
```#include<stdio.h>
#include<stdlib.h>
#include<string.h>

struct data {
int date, month, year;
char name[100];
struct data *next, *prev;

void popAll();
void printAll();
void priorityPush(int, int, int, char*);
int getMonthNumber(char*);
char* getMonthName(int);
long getDateNumber(int, int, int);
struct data *createNode(int, int, int, char*);

long getDateNumber(int date, int month, int year) {
return (long)(year*10000)+(month*100)+date;
}

int getMonthNumber(char *month) {
if(!strcmp(month, "january"))return 1;
if(!strcmp(month, "february"))return 2;
if(!strcmp(month, "march"))return 3;
if(!strcmp(month, "april"))return 4;
if(!strcmp(month, "may"))return 5;
if(!strcmp(month, "june"))return 6;
if(!strcmp(month, "july"))return 7;
if(!strcmp(month, "august"))return 8;
if(!strcmp(month, "september"))return 9;
if(!strcmp(month, "october"))return 10;
if(!strcmp(month, "november"))return 11;
if(!strcmp(month, "december"))return 12;
}

char* getMonthName(int month) {
switch(month) {
case 1: return "january";
case 2: return "february";
case 3: return "march";
case 4: return "april";
case 5: return "may";
case 6: return "june";
case 7: return "july";
case 8: return "august";
case 9: return "september";
case 10: return "october";
case 11: return "november";
case 12: return "december";
}
}

void popAll() {
}

void printAll() {
while(temp != NULL) {
printf("%d %s %d - %s\n", temp->date, getMonthName(temp->month), temp->year, temp->name);
temp = temp->next;
}
}

int date, year;
char month[100], name[100];
scanf("%d %s %d - %[^\n]", &date, &month, &year, &name); getchar();
priorityPush(date, getMonthNumber(month), year, name);
}

struct data *createNode(int date, int month, int year, char *name) {
// [1] INSERT YOUR CODE HERE
}

void priorityPush(int date, int month, int year, char *name) {
// [2] INSERT YOUR CODE HERE
}

// [3] INSERT YOUR CODE HERE
}

int main() {
int totalPatients, totalCure;
scanf("%d %d", &totalPatients, &totalCure); getchar();
for(int i=0; i<totalPatients; i++)

for(int i=0; i<totalCure; i++)

if(totalPatients < totalCure || totalPatients == totalCure)
printf("All patients get the cure, %d cure left\n", totalCure-totalPatients);
else if(totalPatients > totalCure)
printf("Need %d more cure\n", totalPatients-totalCure);

printAll();
popAll();
}```

2. The general idea is you make an attempt - more than just being a copy/paste service for your tutor.

You make an attempt, then ask a question.
We then help correct your mistakes and mis-understandings.

You'll learn a lot more from it - which I assume is the point of you being on the course - to learn stuff.