Reference no: EM13843533
Assignment 2
• Modify the infix evaluaDon program so it processes assignment statements where the expressions can contain variables. A variable will be a string of 1 to 6 alphabeDc characters.
• The values of variables must be stored in a symbol table that is stored in a binary file. The symbol table should be stored as a sorted (based on the variable) sequence. To find the value of variable the program must search the symbol table using a binary search. I will review binary search in class and give an example using an ArrayList
Assignment 2
• All accesses (looking up the current value, giving a variable a new value, etc) to the symbol table must use the binary file. That is you cannot just read in the contents of the file into memory (e.g. into an ArrayList) and then access this informaDon from the ArrayList.
• UniniDalized variables are assumed to have the value 0.
Assignment 2
• The program expects two command line arguments. The first argument is the name of a text file that contains one assignment statement per line. The second command line argument is the name of the binary file that will be used to store the symbol table
• As in assignment one the tokens in the assignment statements will be separated by whitespace.
• You can assume the input is syntacDcally correct
Assignment 2
• AUer all the lines in the input file have been evaluated the program should print the contents of symbol table.
Attachment:- a2.pdf