Hey, So in my prompt output is supposed to be
The following states had these presidents born in them:
Arkansas Clinton
California Nixon
Connecticut Bush_GW
Georgia Carter
Hawaii Obama
Illinois Reagan
Iowa Hoover
Kentucky Lincoln
Massachusetts Bush_GHW Kennedy
Missouri Truman
Nebraska Ford
New_Hampshire Pierce
New_Jersey Cleveland
New_York Fillmore Roosevelt_F Roosevelt_T VanBuren
North_Carolina Johnson_A Polk
Ohio Garfield Grant Harding Harrison_B Hayes McKinley Taft
Pennsylvania Buchanan
Texas Eisenhower Johnson_L
Vermont Arthur Coolidge
Virginia Taylor Tyler Wilson
List of presidents and the state each was born in:
Arthur Vermont
Buchanan Pennsylvania
Bush_GHW Massachusetts
Bush_GW Connecticut
Carter Georgia
Cleveland New_Jersey
Clinton Arkansas
Coolidge Vermont
Eisenhower Texas
Fillmore New_York
Ford Nebraska
Garfield Ohio
Grant Ohio
Harding Ohio
Harrison_B Ohio
Hayes Ohio
Hoover Iowa
Johnson_A North_Carolina
Johnson_L Texas
Kennedy Massachusetts
Lincoln Kentucky
McKinley Ohio
Nixon California
Obama Hawaii
Pierce New_Hampshire
Polk North_Carolina
Reagan Illinois
Roosevelt_F New_York
Roosevelt_T New_York
Taft Ohio
Taylor Virginia
Truman Missouri
Tyler Virginia
VanBuren New_York
Wilson Virginia
These presidents were born before the states were formed:
Adams_J
Adams_JQ
Harrison_W
Jackson
Jefferson
Madison
Monroe
Washington
These states had no presidents were born in them:
Alabama
Alaska
Arizona
Colorado
Delaware
Florida
Idaho
Indiana
Kansas
Louisiana
Maine
Maryland
Michigan
Minnesota
Mississippi
Montana
Nevada
New_Mexico
North_Dakota
Oklahoma
Oregon
Rhode_Island
South_Carolina
South_Dakota
Tennessee
Utah
Washington
West_Virginia
Wisconsin
Wyoming
and I'm hardcoding my code with this text file :
Virginia Tyler Taylor Wilson
Ohio Grant Hayes Garfield Harrison_B McKinley Taft Harding
Massachusetts Kennedy Bush_GHW
New_York VanBuren Fillmore Roosevelt_T Roosevelt_F
North_Carolina Polk Johnson_A
Texas Eisenhower Johnson_L
Vermont Arthur Coolidge
Arkansas Clinton
California Nixon
Connecticut Bush_GW
Georgia Carter
Hawaii Obama
Illinois Reagan
Iowa Hoover
Kentucky Lincoln
Missouri Truman
Nebraska Ford
New_Hampshire Pierce
New_Jersey Cleveland
Pennsylvania Buchanan
I've been able to get the first two outputs correctly, though I can't get the second or third one. The third output is asking me to
"Print a sorted list of presidents who have no birth state associated with them. These presidents were actually born on this continent but were born before the states were created."
and the fourth prompt asks
Print a sorted list of states that have no president born in them. You may use the allstates.txt file for this.
Here's my code:
Does anyone know how I can go about trying to solve this problem?