title: How to write a menu driven program in java with an if else statement embedded within a switch case
body: <p>I am trying to write a menu driven program in java language to calculate the cost of attendance for various types of students at this specific university. I am running into problems with my output, when I run my program none of my cases execute upon entering the according letter. If there are any tips in helping fix my output problem I would greatly appreciate it.</p>
  
  <pre><code>int cred, sem, cost, tuition;
  char choice;
  
  Scanner sc = new Scanner(System.in);
  do {
      System.out.println("Enter a for a non resident Grad student/n");
      System.out.println("Enter b for a resident Grad student/n");
      System.out.println("Enter c for an international Grad student/n");
      System.out.println("Enter d for a non resident UnderGrad student/n");
      System.out.println("Enter e for a resident UnderGrad student/n");
      System.out.println("Enter f for an international UnderGrad student/n");
      choice = sc.next().charAt(0);
      tuition = sc.nextInt();
  
      switch (choice) {
          case 'a':
              System.out.println("Enter number of credits being taken: ");
              cred = sc.nextInt();
              cost = (780 * cred) + (145 * cred);
              break;
  
          case 'b':
              System.out.println("Enter number of credits being taken: ");
              cred = sc.nextInt();
              cost = (510 * cred) + (110 * cred);
              break;
  
          case 'c':
              System.out.println("Enter number of credits being taken: ");
              cred = sc.nextInt();
              cost = (850 * cred) + (155 * cred);
              break;
          case 'd':
              System.out.println("Enter number of credits being taken: ");
              cred = sc.nextInt();
              if (cred &gt; 18)
                  tuition = (475 * (cred - 18) + 5850);
              else if (cred &lt; 12)
                  tuition = (475 * cred);
              else
                  tuition = 5850;
          case 'e':
              System.out.println("Enter number of credits being taken: ");
              cred = sc.nextInt();
              if (cred &gt; 18)
                  tuition = (325 * (cred - 18) + 4000);
              else if (cred &lt; 12)
                  tuition = (325 * cred);
              else
                  tuition = 4000;
          case 'f':
              System.out.println("Enter number of credits being taken: ");
              cred = sc.nextInt();
              if (cred &gt; 18)
                  tuition = (625 * (cred - 18) + 7550);
              else if (cred &lt; 12)
                  tuition = (625 * cred);
              else
                  tuition = 7550;
      }
  }
  while (choice != 's');
  System.out.println("Cost of attendance= " + tuition);
  </code></pre>