Java Lab 11: Students – Part 2 Monday, July 05, 2004 Read instructions carefully! Following instructions is part of the grade for this lab. This lab is due at 5 pm today, at which point solutions will be posted at a location to be announced to the class. Having the lab due at 5 pm implies that you should save all your files and leave your machine by 5 pm. Failure to turn in the lab promptly at 5 pm will be penalized by taking off 1 point. Make sure you read through the entire lab before attempting any of the parts to manage your time appropriately. We will also be grading the neatness of and comments in your code. Please look over the solutions that we give you for guidelines on how to present your code. 1 point will be taken off for code that is not neat or has no comments. 0. In this lab, you will continue working on the files that you created for lab 10. You therefore need not create a new folder to complete this lab. A university tells you they want to use the student objects that you built in their new software system. For the rest of the lab, you will be improving your student objects to meet the needs of the university. 1. (1 point) The university wants to be able to easily print out descriptions of every student. In the main method of StudentTest, add the instances of Undergrad, Grad, Intern, and Research Assistant that you created in the last lab to an ArrayList. Iterate through the ArrayList, cast each element to a Student and print out the return value of the description method of each. Try to compile. The call to the description method should generate a "cannot resolve symbol" error. Why? Explain in the file lab11.txt. 2. (2 points) Fix the error by adding a dummy description method to Student which returns null. Compile and run. 3. (3 points) The university tells you that they do not want the Student class to be instantiated, and they want to guarantee that every subclass of Student implements the description method. Change the Student class so it meets these two requirements. Compile and run. 4. (1 point) The university wants to be able to use your objects in their student payroll system. They need to be able to easily print out the pay of all the interns and research assistants. In the main method of StudentTest, create an ArrayList with just Interns and ResearchAssistants. Is it possible to iterate through the ArrayList, cast each to a Student, and call getPay on each? Explain in the file lab11.txt. 5. (3 points) Create an Employee interface with a single method, getPay. Have Intern and ResearchAssistant implement that interface. Now iterate through your list of employees and print out the pay of each. 6. (5 points) (Optional) Write a program that the university can use to manage its students. The program can do whatever you want, so long as you think the university would find it useful. For example, it could print out a menu of options and allow the user to create all different types of students and print out the description of students and the pay of all the student employees. You can add new properties to your students or create new types of students if you wish. Be creative. 7. CheckOff Please ensure that you have all the required files in the folder named lab10. These files should compile successfully. Failure to compile will automatically cost you 1 point. If you are ready to be checked off before 5 pm, call one of the team members who will assign you a grade for the lab. Otherwise, you should leave the required files on your machine for us to evaluate at our own convenience. We will not accept modifications to the required files after the lab is officially due.