go to previous page   go to home page   go to next page

Is $__0__$ a legal Java identifier?

Answer:

Yes, but not a recommended choice.


Practical Programs

A somewhat more practical application is a program that verifies that a date is in the correct format. For this program, dates are expected to be in the format: dd/mm/yy . The day and month can be "1" as well as "01", "2" as well as "02" and so on. The year must be two digits. The automaton will not reject non-existant dates such as "43/13/01". It only looks at syntax. Perhaps it verifies the correct form of input for another program that does check for absurd dates.

Here is the automaton, but the transitions have not been labeled. Your job is to label them.

               
==> STATE ==> STATE ==> STATE ==> STATE ==> STATE ==> STATE ==> FINAL STATE
    down arrow   up arrow down arrow   up arrow        
      STATE short   STATE short        
                       

QUESTION 18:

Not all browsers display the above diagram sensibly. If yours does, click on the buttons to see the correct labels.