Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java code please Overview The goal of this assignment is to learn how to use the dictionary abstract data type in Java, sorting on lists,
Java code please
Overview The goal of this assignment is to learn how to use the dictionary abstract data type in Java, sorting on lists, and to continue practice reading parameters in from the command line (Eclipse has an interface for providing command-line options to a Java program, see Run As > Run Configurations > Arguments). In Java, a HashMap implements a dictionary. By the end of the assignment you will have practiced using the following operations on a HashMap: insertion modifying the value for a particular key iterating over all of the key, value pairs the fact that HashMaps do NOT store their key, value pairs in order and how to handle it Like in PA1, for PA2 you will be taking an input file name from the command line. In addition to the input file, the second command-line argument will be a command to run on the data from your input file. The commands consist of CATCOUNT and LOCATIONS. If an unknown command is provided, the program should print the message: Invalid Command 1 Each command will be most easily implemented with a HashMap. Therefore, your imple- mentation will read in the csv file and be using one or more HashMaps. CATCOUNT - This command reads an input file and for each job "Category" prints out the category and the number of jobs in that category. LOCATIONS - For a given category, list the locations that have a position in that category open. Each location will be followed by a number indicating how many positions in that category are open in a particular location. Input and Output Example input (see Kaggle for more in-depth description). The cutoff word below is "Qualifications". Company, Title, Category, Location, Responsibilities, Minimum Qualifications, Preferred Qualific Google, TitleA, Categoryx, Tel Aviv, Everything and the rest, BS, MS Google,TitleB, Categoryx, Tel Aviv, Everything and the rest, BS, MS Google,TitleB, Categoryy, Houston, Everything and the rest, BS, MS Google,Titlec, Categoryx, Jonesboro, Everything and the rest, BS, MS Output for command line arguments 'CATCOUNT' Number of positions for each category CategoryX, 3 CategoryY, 1 Output for command line arguments LOCATIONS CategoryX' LOCATIONS for category: CategoryX Jonesboro, 1 Tel Aviv, 2 Hints The class notes posted on piazza have examples of reading from the command line. The input files are CSV files for this assignment, you can assume that splitting on commas is ok. Since HashMaps are unordered, special steps must be taken for them to be outputted in an ordered format. As shown below, take the set of keys and input it into an ArrayList of type String. Then use a Collections sort to sort the keys in place. ListStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started