here's my code.. its set up so that if you type anything in that's not a menu option it will display that error message.. but if you type in more then on character for choice it will print the error based on how many characters you type in for choice.




Code:
#include <iostream.h>
#include <math.h>
#include <iomanip.h>

void menu(void); // displays menu
void sinusoid(double& freq, double& amp, double& phase); // option A
void calcsignal(double freq, double amp, double phase); // option b
void complex(void); // option C
double arctan(double y, double x);  // subroutine of complex()
void samplecalc(double sampfreq,double samptime,double freq,double amp,double phase); // subroutine of calcsignal

const double pi = 3.1415926535; // global variable








int main(void)
{
      char choice;             // menu choice
      double freq, amp, phase; // 3 variables of sinusoid

      freq = 'a';       // used for error if user doesn't do option A
      amp = 'b';        //  before option B
      phase = 'c';      //

      do {
      menu();
      cin >> choice;

      if (choice == 'a' || choice == 'A')
      {
      sinusoid(freq, amp, phase);
      }


      else if (choice == 'b' || choice == 'B')
      {
      calcsignal(freq,amp,phase);
      }


      else if (choice == 'c' || choice == 'C')
      {
      complex();
      }


      else if (choice == 'q' || choice == 'Q') break;


      else
      {
      cout << endl;
      cout << "ERROR: Incorrect Choice!";
      cout << endl;
      }

         }while (1);
      return 0;
}