You must do every programming assignment by yourself. You are permitted to get help ONLY from the TAs and Dr. Patt. When you have completed the program, and tested it sufficiently so that you are comfortable that it works on any input, submit it for grading according to the submission instructions at the end of this handout.
Programming Assignment 4: The Payroll Program
Your job: Write a program in LC-3 assembly language that prompts the user to enter the name of a professor, searches a database for that professor, and prints to the screen that professor's salary. The database of professors will be stored in memory as a binary tree. We refer to the "top" node of a binary tree as the ROOT of the tree. The address of the root can be found at memory location x4000.
A binary tree is a special case of a tree where each node has at most two child nodes. We refer to the two children as the left child and the right child. In this lab, each node of the tree will consist of 4 words: a pointer to the left child if one exists, a pointer to the right child if one exists, a pointer to the ASCII string containing the professor's name, and a 2's complement number representing the professor's salary. If there is no left or right child, the corresponding word will contain the null pointer. We have provided an example binary tree shown below, and provided the assembly code for that tree here.
Note that a binary tree consists of a root and up to two children, each of which is in itself the root of a binary tree. In the example below, Joe is the root of the binary tree, its child Daniel is the root of a binary tree often referred to as the left subtree, and its child Ali is the root of a binary tree often referred to as the right subtree.
Hint: the above paragraph should give you a hint about the best way to solve this programming problem, i.e., by using recursion.
Type a professor's name and then press Enter:Dan 16000 Type a professor's name and then press Enter:Dani No Entry Type a professor's name and then press Enter:Daniel 24000 Type a professor's name and then press Enter:dan No Entry Type a professor's name and then press Enter:d ----- Halting the processor ----
Submission Instructions: Your program should be submitted as a single file called salary.asm. You MUST name your file EXACTLY as specified. Failure to do so will result in a loss of points on the assignment. The one .asm file should be submitted to Canvas by the deadline.