All pastes #912916 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-02-21 18:41 UTC
rendered paste body
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "course.h"

int Quit(void)
{
    char quitchoice;
    printf("Are you sure? y/n");
    scanf("%c",&quitchoice);
    switch(quitchoice)
    {
    case 'y':
          return(0);
         break;
    case 'n':
         return(1);
         break;
    }                   
}

int main(void)
{
    int i = 1;
    while(i == 1)
    {
    char choice;
    printf("[L]oad Database \n[S]ave Database \n[P]rint Info \n[H]istogram \n[A]dd Student \n[R]emove Student \n[Q]uit \n\nMake your choice >>");
    scanf("%c",&choice);
    switch(choice)
                  {
                  case 'q': 
                       Quit();
                       break;
                  default:
                          printf("There is no such command, please retry!\nTry again >>\n");
                          break;
                  }
    i = Quit();
    }

    
    return 0;
}