JAVA - error variable for do.. while
<p>I having issue when compiling my assignment code.</p>

<p>When I use the scanner input for the switch menu as integer value, the <code>do-while</code> is working fine, but due to assignment requirement, the menu input need to be char, so I alter it as below, but it keeps giving me error stating the variable of <code>m</code> is not found.</p>

<pre><code>do {
  System.out.println(displayMenu(""));
  option = scn.nextLine();
  char m = option.charAt(0);

  switch (m) {    
    case 'A': TMA_Q3.enterInput(0); break;
    case 'B': System.out.println(" "); break;
    case 'C': System.out.println(""); break;  
    case 'D': System.out.println(""); break;
    case 'E': System.out.println(""); break;
    case 'F': System.out.println(""); break;

  }
} while(m != 'F'); // error occurs on this line stating m is not found
</code></pre>
