Provided Files:
β’ A1.c – A lexical analyzer program (written in C) for simple arithmetic expressions.
β’ A1.java – A shell file with a main method and the header information.
β’ input1.txt – A sample input file.
β’ input2.txt – A sample input file.
β’ output1.txt – The required output for the example input1.txt file.
β’ output2.txt – The required output for the example input2.txt file.
Description: Convert the C implementation of lexical analyzer A1.c to an equivalent Java program. Given a particular input, your Java program should produce the same output that A1.c produces. Use a diff tool to ensure your program produces the correct output. Even minor differences in output will cause you to fail grading tests and lose points.
Submission: your A1.java file.
General Programming Assignment Requirements:
β’ Classes must be in the default (no package statement) unless otherwise specified. You will lose 20 points (all points) if you put a package statement in your program.
β’ If your program that does not compile or does not run, you will lose all points.
β’ If you submit the wrong file your grade will suffer accordingly. Most likely a 0.
β’ Screen shots with time stamps of “last modified” from your system are proof of nothing. It is trivial to change the system time on computers or to Photoshop “evidence”.
β’ Likewise if I ask for the source code, the .java file, and you submit the .class file your grade will be 0.
Checklist: Did you remember to:
β’ worked on the programming assignment by yourself?
β’ fill in the header in your file A1.java?
β’ ensure your program does not suffer a compile error or runtime error?
β’ ensure your program creates the correct output and that it matches the expected output exactly?
β’ put a comment at the start of each method describing in broad terms, what it does?
β’ properly indent your source code so that your indenting is readable and consistent?
β’ use good names for variables to make your program easy to understand?
Page 1 of 1




