#include <stdio.h> 
int main () 
{ 

    char answer[20];   /* user response to yes or no question */ 
    int score;               /* test score */ 

    printf ("\nEnter a score: "); 
    scanf ("%i", &score); 

    /* Process Grade and Options based on Score */ 
    if (score <0 || score > 100) 
        printf ("\nError, Invalid Grade \n"); 

    else if (score >= 90)  /* 90-100 */ 
    { 
        /* you need these students, but can't make any money from them :) */ 
        printf ("\nExcellent Job: Grade is an A \n"); 
    }  /* 90 - 100 */

    else if (score >= 80)  /* 80-89 */ 
    { 
        printf ("\nGood Job: Grade is a B \n"); 
        printf ("Would you like an A? (y/n): "); 
        scanf ("%s", answer); 

        /* Come on, answer yes, professor needs a new electronic toy */ 
        if (answer[0] == 'y' || answer[0] == 'Y') 
        { 
            /* All right, a customer */ 
            printf ("\nMake check payable to Tim Niesen for $200\n"); 
            printf ("... a small price to pay for your education \n"); 
        } 
    }  /* 80 - 89 */

    else if (score >= 70) /* 70 - 79 */ 
    { 
        printf ("\nFair Job: Grade is a C \n"); 
        printf ("Would you like an A? (y/n): "); 
        scanf ("%s", answer);   /* The & not needed with Arrays, will discuss this in the future */ 

        /* time to make some real money, my favorite students */ 
        if (answer[0] == 'y' || answer[0] == 'Y') 
        { 
            printf ("\nMake check payable to Tim Niesen for $600 \n"); 
            printf ("... an excellent price to pay for your education \n"); 
        } 

        else  /* maybe the student will pay to get a B ? */
        { 
            printf ("\nWould you like an B? (y/n): "); 
            scanf ("%s", answer); 

            if (answer[0] == 'y' || answer[0] == 'Y') 
            { 
                printf ("\nMake check payable to Tim Niesen for $400 \n"); 
                printf ("... a great price to pay for your education \n"); 
            } 
        } 

    }  /* 70 - 79 */

    else if (score >= 60) /* 60 - 69 */ 
    { 
        /* just can't make any money here, would not be right */ 
        printf ("\nPoor Job: Grade is a D \n"); 
        printf ("... You're beyond a bribe to get a better grade \n"); 
    }  /* 60 - 69 */

    else  /* < 60 */ 
    { 
        printf ("\nYou Failed: Grade is an F :(\n"); 
    } 

    return (0); /* success */ 

} /* end main */