Question: Write a program in either Java 1 7 or later ( called HH . java ) or Python 3 . 1 1 or later (
Write a program in either Java or later called HHjava or Python or later called HHpy to
implement the HuntingtonHill algorithm described in the textbook. Write the program so that:
it implements the method APPORTIONCONGRESS given in pseudocode in figure on page of
the textbook; note that the method takes two parameters: an array of state populations and the
number of representatives.
contains a main method that reads in the population data from a file described below, calls the
method APPORTIONCONGRESS and passes it an array of the populations and the value the
number of representatives
prints a list showing with each states name, a tab character, and the number of representatives
apportioned to that state on its own line. For example, the first few lines might look something
like:
Alabama
Alaska
Arizona
The population file, STATEPOPULATIONS.TXT contains lines, one for each state. Each line contains the
states name, a space, and an integer population.
Write the program so that it can be run from the Windows command line as follows:
For Java: java HH StatePopulations.txt
For Python: python hhpy StatePopulations.txt
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
