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 17 or later (called HH.java) or Python 3.11 or later (called HH.py) to
implement the Huntington-Hill algorithm described in the textbook. Write the program so that:
it implements the method APPORTIONCONGRESS given in pseudocode in figure 0.5 on page 9 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 435(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 6
Alaska 1
Arizona 10
The population file, STATEPOPULATIONS.TXT, contains 50 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 hh.py StatePopulations.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!