Question: Create a program that reads in the Courses objects from either the text file you created in Homework 1. (Yes, you can use the code
Create a program that reads in the Courses objects from either the text file you created in Homework 1. (Yes, you can use the code from previous homeworks) or the binary file from Homework 2. Please make sure to include ALL FILES NEEDED TO COMPILE (Course.java, English.java, Math.java, History.java)
Implement your own HashMap implementation. You may use the HashMap example provided in the notes, but you MUST modify it to handle Course bjects only and bring it completely up to coding standards to receive all points. You MAY NOT use java.util.HashMap or java.util.TreeMap in this problem.
After reading in the Course objects, store the Course objects into your HashMap implementation using the unique ID as the key to the map rather than storing them in the ArrayList used in Homework 1. Then print the Course objects from the HashMap in a user friendly fashion. You may use iterator or for-each loop-> DO NOT JUST System.out.println THE HASHMAP- ITERATE THROUGH IT. Hint: Modify your toString to get a nice looking output.
Homework 1 Screenshots below as source code is too long












import public classCourse implements Serializable private String category; private String name; private int srR: Constructor with all parameters set. Oparam category param name @param GrR public Course(String category, String name, int sTA) super) this*sateeorx - category; this.namename; Method that determines what prints when object is printed. (non-Javadoc) see @Override public String toStcing() return category +", "name+ Getter method for category return the category public String setcategecx) return category; Setter method for category Oparam category the category to set public void setCategecx(String category) this sateggrx category; Getter method for name return the name public String getName) return name; *Setter method for name param name the name to set public void setName(String name) this.namename; Getter method for ccp Oreturn the soR public int setccac) return SR: Setter method for ccp @param GrR the scR to set public void setSrn(int Ca import import public class Coursekist // actual Coucseist data private Aaist
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
