1. Explain whether or not the switch is an essential program construction.

  2. Add a delete command to my menu structure which is activated by the letter d.













Answers
  1. The switch can be easily done without by using a series of if instructions. It does however make programming easier

  2. switch ( ch )
    {
        case 'D' :
        case 'd' :
            delete_function();
            break;
        case 'S' :
        case 's' :
            save_function () ;
            break ;
        case 'L' :
        case 'l' :
            load_function () ;
            break ;
        case 'Q' :
        case 'q' :
            quit_function () ;
            break ;
        default :
            bad_command () ;
            break ;
    }