/* Final.c */
#include <stdio.h>

main()
{
 const int YES = 1;
 const int NO = 0;

 int exempt_from_final;
 float my_average;
 int my_days_absent;

 exempt_from_final = NO;

 printf("What is your course grade average? ");
 scanf("%f", &my_average);

 printf("How many days were you absent from class? ");
 scanf("%d", &my_days_absent);

 if (my_average >= 90)
  {                                /* if your average is 90 or better */
   if (my_days_absent <= 3)        /* and you have missed three days */
     { exempt_from_final = YES; }  /* or less, you are exempt. */
  }
 else  /* if you don't have a 90+ average, you still have a chance */
  { if (my_average >= 80)
    {                                /* if your average is 80 or better */
     if (my_days_absent <= 1)        /* and you have missed one day or */
       { exempt_from_final = YES; } /* less, you are exempt. */
    }
  }

 /* notify student of the decision */
 if (exempt_from_final)
  { printf("You are exempt from the final exam.\n"); }
 else
  { printf("You must take the final exam for the course.\n"); }

 return 0;
}
