subject

Hiring Policies After being promoted, you now have access to all student data in FooBar High School. Your task is to parse through student information and decide which class would be the best for FooBar Incorporated's upcoming targetted hiring project (only the best, most sinister minds make it!). Beware, FooBar is extremely evil and are looking for the most lucrative class of CS majors. You should write two methods, determineMajor and report Statistics. The determineMajor method takes in a Scanner containing file data as a parameter and returns an integer array that contains the number of CS majors in each class standing. For this array (of size 4) the indices represent the year that a student is. That is, index o represents freshmen, index 1 represents sophomores, index 2 represents juniors and index 3 represents seniors. Your input file for this program (hiring_info. txt ) will always be in the format of class-standing major and you can always assume that these exist in pairs with cs always being capitalized. For instance hiring_info. txt could look like, Sophomore English Senior CS Senior cs Junior Electrical Senior History Sophomore CS Freshman Informatics For this input file, a call to determineMajor (Scanner input) looks like Scanner input = new Scanner(new File("hiring_info. txt")); int[] counts = determineMajor (input); After this code is executed, counts would store: To, 1. 0 21 [0, 1, 0, 2] because there are o freshmen that are CS majors, 1 sophomore that is a CS major, o juniors that are CS majors and 2 seniors that are CS majors. The reportStatistics method should then format output from this array. A call to reportStatistics (int[] counts, PrintStream output) such as reportStatistics(counts, output); should print out all the information to a PrintStream object. Specifically, it should report how many CS majors each class has and the suggested class to hire, which is the class with the most CS majors. You may assume that two classes will not both share the largest number of CS majors. For example, with this same input file, the output file would look like Freshman class has o cs Majors Sophomore class has 1 cs Majors Junior class has o cs Majors Senior class has 2 CS Majors Suggested Hire: Senior class Make sure that your PrintStream produces this output in the exact same format

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:30
Active listen eliminates barries to communication true or false
Answers: 1
question
Computers and Technology, 22.06.2019 13:30
Write lines of verse that rhyme to remember the following information: acid rain is a type of air pollution caused by chemicals in the air.
Answers: 1
question
Computers and Technology, 22.06.2019 22:40
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
question
Computers and Technology, 23.06.2019 16:30
Monica and her team have implemented is successfully in an organization. what factor leads to successful is implementation? good between different departments in an organization leads to successful is implementation.
Answers: 1
You know the right answer?
Hiring Policies After being promoted, you now have access to all student data in FooBar High School....
Questions
question
Mathematics, 27.07.2021 03:00
question
Mathematics, 27.07.2021 03:00
question
Mathematics, 27.07.2021 03:00
question
Mathematics, 27.07.2021 03:00
Questions on the website: 13722361