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 04:30
Which of the statements below is true? the formatting, standard, and drawing commands are unavailable. the formatting, standard, and drawing commands have been used. the formatting, standard, and drawing toolbars are displayed. the formatting, standard, and drawing toolbars are hidden.
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
question
Computers and Technology, 24.06.2019 10:00
In which view can you see speaker notes?
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
Write a new lc-3 trap subroutine (i.e. a subroutine that will be invoked via the trap instruction) that will receive a numeric digit entered at the keyboard (i.e. an ascii character), echo it to the screen, and return in r0 the corresponding numeric value: so if the user types the digit '7', the character '7' will appear on the screen, but the value returned in r0 will be b0000 0000 0000 0111 (#7) you may not use any trap calls in your code - you must implement the "polling" code that interrogates the keyboard status and data registers. ; getnum_tsr ; a subroutine for obtaining a numeric value ; given ascii numeric digit input to keyboard. ; the numeric digit is echoed to the console (e.g. '7' = b0000 0000 0011 0111), ; but the value returned in r0 is the actual numeric value ; corresponding to the digit (e.g. b0000 0000 0000 0111 =
Answers: 3
You know the right answer?
Hiring Policies After being promoted, you now have access to all student data in FooBar High School....
Questions
question
History, 02.08.2019 19:40
Questions on the website: 13722362