Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poverty Project - Java and Python #9

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
18c1ec8
create gitignore and county and program class files
kedevlin Apr 5, 2016
69dd1c4
program captures user input
kedevlin Apr 6, 2016
ba3dfa1
update prompt
kedevlin Apr 6, 2016
464d2fe
add wa txt file, program is able to read first line from it
kedevlin Apr 6, 2016
a14c0f0
program can print a specific line
kedevlin Apr 6, 2016
9899562
program successfully finds line matching user input
kedevlin Apr 6, 2016
fcac531
add california txt file, user can choose state and county and program…
kedevlin Apr 6, 2016
91ff514
update prompt
kedevlin Apr 6, 2016
dfba932
add system output describing relevant county info
kedevlin Apr 6, 2016
ab8759e
add constructor to county class, program creates new county object if…
kedevlin Apr 6, 2016
fe894ff
add file to county class constructor
kedevlin Apr 6, 2016
7910714
remove line_num variable, change county class constructor to take in …
kedevlin Apr 6, 2016
2578d35
poverty percent is an attribute of county, program outputs this value…
kedevlin Apr 6, 2016
8d71998
program displays number of children in poverty and median household i…
kedevlin Apr 6, 2016
a7bafbf
program displays required info for user selected county
kedevlin Apr 6, 2016
bec19c8
handle other states and other input besides wa and ca
kedevlin Apr 7, 2016
1d2e7ad
change no_county variable to countyFound
kedevlin Apr 7, 2016
918960c
change user_county to userCounty
kedevlin Apr 7, 2016
3a5c908
change county attribute variable names to lower camel case
kedevlin Apr 7, 2016
74e7e31
make name name column index range constants
kedevlin Apr 7, 2016
e1a47bc
user input for state in a while loop
kedevlin Apr 7, 2016
e4ea2cb
rename scanner variables
kedevlin Apr 7, 2016
c68e21d
move close of scanInput to end of method
kedevlin Apr 7, 2016
2babb5c
move county user input to while loop
kedevlin Apr 7, 2016
269c726
remove if statement for county not found
kedevlin Apr 7, 2016
858f997
end program if q is entered for state input
kedevlin Apr 7, 2016
a497429
allow user to exit during county input loop
kedevlin Apr 7, 2016
c5fe4a7
create method to find extreme pov percents for a given state's file, …
kedevlin Apr 7, 2016
d49a95b
extreme county finder method works for finding county with lowest per…
kedevlin Apr 7, 2016
8a11323
print all required info
kedevlin Apr 7, 2016
fc72fb0
create python files
kedevlin Apr 7, 2016
564d7fb
open and close two files
kedevlin Apr 7, 2016
4f300a2
create find_extreme_county method
kedevlin Apr 7, 2016
9d54ecf
import County class in program file, return county with highest pov p…
kedevlin Apr 7, 2016
ab718b1
all required attributes for county exist and print for highest of eac…
kedevlin Apr 7, 2016
16bab6c
add if else statement for finding highest or lowest poverty in each s…
kedevlin Apr 8, 2016
3f01809
print details of highest and lowest poverty counties for each state
kedevlin Apr 8, 2016
12d00da
capture user input for state
kedevlin Apr 8, 2016
1d52abf
if else statement for setting file name or quitting program
kedevlin Apr 8, 2016
1cf4d09
capture user input for county
kedevlin Apr 8, 2016
4b6be08
create print_county method for printing matching counties and determi…
kedevlin Apr 8, 2016
323bb7f
prompt user for county until county is found or user types q
kedevlin Apr 8, 2016
6501cec
program re-prompts user for state until wa, ca, or q is entered
kedevlin Apr 8, 2016
5de7f52
remove county.pyc from git
kedevlin Apr 8, 2016
fca1bfa
update .gitignore to include pyc files
kedevlin Apr 8, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add wa txt file, program is able to read first line from it
kedevlin committed Apr 6, 2016
commit 464d2fe9ef65a915f0dc1f346983d11432840b2f
14 changes: 14 additions & 0 deletions poverty/src/poverty/Program.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package poverty;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Program {
@@ -10,5 +12,17 @@ public static void main(String[] args) {
String county = scan.nextLine();
System.out.println("County: "+ county);
scan.close();

File washington = new File("washington.txt");

try {
Scanner scanner = new Scanner(washington);
String line = scanner.nextLine();
System.out.println("Data: " + line);
scanner.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
}

}
}
40 changes: 40 additions & 0 deletions poverty/washington.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
53 0 913463 895355 931571 13.2 12.9 13.5 275662 265882 285442 17.5 16.9 18.1 180464 171990 188938 16.0 15.2 16.8 61358 60882 61834 85453 80800 90106 19.6 18.5 20.7 Washington WA est14_WA.txt 06NOV2015
53 1 3598 2947 4249 19.0 15.6 22.4 1816 1477 2155 27.1 22.0 32.2 1152 903 1401 24.7 19.4 30.0 47423 42474 52372 Adams County WA est14_WA.txt 06NOV2015
53 3 3573 2849 4297 16.3 13.0 19.6 1104 846 1362 24.2 18.5 29.9 723 546 900 21.5 16.2 26.8 44055 39944 48166 Asotin County WA est14_WA.txt 06NOV2015
53 5 26893 23628 30158 14.6 12.8 16.4 10421 8839 12003 21.3 18.1 24.5 6754 5615 7893 19.0 15.8 22.2 58750 56072 61428 Benton County WA est14_WA.txt 06NOV2015
53 7 10298 8470 12126 14.0 11.5 16.5 3588 2774 4402 20.2 15.6 24.8 2436 1839 3033 19.2 14.5 23.9 49174 45028 53320 Chelan County WA est14_WA.txt 06NOV2015
53 9 11518 9848 13188 16.2 13.8 18.6 3267 2671 3863 26.2 21.4 31.0 2025 1593 2457 22.3 17.5 27.1 47185 43543 50827 Clallam County WA est14_WA.txt 06NOV2015
53 11 44213 38703 49723 9.9 8.7 11.1 15179 12259 18099 13.6 11.0 16.2 10647 8436 12858 12.8 10.2 15.4 61747 60396 63098 Clark County WA est14_WA.txt 06NOV2015
53 13 607 469 745 15.5 12.0 19.0 190 145 235 25.7 19.6 31.8 130 98 162 22.0 16.6 27.4 45465 41255 49675 Columbia County WA est14_WA.txt 06NOV2015
53 15 20701 18425 22977 20.6 18.3 22.9 6118 5100 7136 26.8 22.3 31.3 3909 3166 4652 23.1 18.7 27.5 44235 41355 47115 Cowlitz County WA est14_WA.txt 06NOV2015
53 17 6120 4978 7262 15.5 12.6 18.4 2507 1974 3040 24.4 19.2 29.6 1712 1339 2085 22.7 17.8 27.6 51151 47257 55045 Douglas County WA est14_WA.txt 06NOV2015
53 19 1700 1392 2008 22.4 18.3 26.5 403 316 490 29.1 22.8 35.4 264 205 323 25.9 20.1 31.7 39992 36038 43946 Ferry County WA est14_WA.txt 06NOV2015
53 21 14661 12404 16918 17.3 14.6 20.0 7214 6027 8401 24.9 20.8 29.0 4533 3611 5455 22.4 17.8 27.0 55006 51191 58821 Franklin County WA est14_WA.txt 06NOV2015
53 23 310 240 380 14.2 11.0 17.4 91 70 112 20.7 15.8 25.6 60 45 75 17.4 13.1 21.7 46404 41508 51300 Garfield County WA est14_WA.txt 06NOV2015
53 25 14508 11796 17220 15.8 12.8 18.8 5766 4441 7091 20.9 16.1 25.7 3918 2983 4853 20.0 15.2 24.8 50388 47611 53165 Grant County WA est14_WA.txt 06NOV2015
53 27 13322 11257 15387 19.6 16.6 22.6 4146 3376 4916 28.6 23.3 33.9 2760 2199 3321 26.3 21.0 31.6 43205 40965 45445 Grays Harbor County WA est14_WA.txt 06NOV2015
53 29 7964 6639 9289 10.3 8.6 12.0 2267 1801 2733 15.4 12.2 18.6 1514 1190 1838 14.7 11.6 17.8 59358 55827 62889 Island County WA est14_WA.txt 06NOV2015
53 31 4183 3445 4921 14.1 11.6 16.6 972 770 1174 24.5 19.4 29.6 643 502 784 21.8 17.0 26.6 50964 46641 55287 Jefferson County WA est14_WA.txt 06NOV2015
53 33 230750 218081 243419 11.3 10.7 11.9 58351 52757 63945 13.6 12.3 14.9 38527 34470 42584 12.8 11.5 14.1 75738 74417 77059 King County WA est14_WA.txt 06NOV2015
53 35 27550 23819 31281 11.2 9.7 12.7 7473 6103 8843 14.4 11.8 17.0 4593 3607 5579 12.2 9.6 14.8 61898 59584 64212 Kitsap County WA est14_WA.txt 06NOV2015
53 37 7459 6329 8589 18.6 15.8 21.4 1410 1105 1715 18.7 14.7 22.7 953 742 1164 17.6 13.7 21.5 48127 44926 51328 Kittitas County WA est14_WA.txt 06NOV2015
53 39 3029 2365 3693 14.6 11.4 17.8 935 713 1157 22.6 17.2 28.0 641 481 801 20.9 15.7 26.1 49348 44723 53973 Klickitat County WA est14_WA.txt 06NOV2015
53 41 12695 10463 14927 17.1 14.1 20.1 3912 3075 4749 24.5 19.3 29.7 2600 2017 3183 22.3 17.3 27.3 44243 40710 47776 Lewis County WA est14_WA.txt 06NOV2015
53 43 1274 1002 1546 12.5 9.8 15.2 392 303 481 17.7 13.7 21.7 269 207 331 15.7 12.1 19.3 49955 45180 54730 Lincoln County WA est14_WA.txt 06NOV2015
53 45 9040 7636 10444 15.6 13.2 18.0 2660 2093 3227 23.6 18.6 28.6 1805 1406 2204 22.4 17.4 27.4 52313 49305 55321 Mason County WA est14_WA.txt 06NOV2015
53 47 9427 8024 10830 23.2 19.8 26.6 2969 2411 3527 31.5 25.6 37.4 1992 1578 2406 29.5 23.4 35.6 37782 34745 40819 Okanogan County WA est14_WA.txt 06NOV2015
53 49 3606 2929 4283 17.8 14.5 21.1 965 775 1155 28.8 23.1 34.5 674 538 810 28.0 22.4 33.6 40189 36441 43937 Pacific County WA est14_WA.txt 06NOV2015
53 51 2868 2398 3338 22.3 18.6 26.0 842 665 1019 33.1 26.2 40.0 588 463 713 30.2 23.8 36.6 42579 38373 46785 Pend Oreille County WA est14_WA.txt 06NOV2015
53 53 106432 97890 114974 13.1 12.1 14.1 34165 30111 38219 17.5 15.4 19.6 22439 19462 25416 16.2 14.1 18.3 60397 58946 61848 Pierce County WA est14_WA.txt 06NOV2015
53 55 2018 1729 2307 12.7 10.9 14.5 437 351 523 19.6 15.7 23.5 290 227 353 16.7 13.1 20.3 54721 50513 58929 San Juan County WA est14_WA.txt 06NOV2015
53 57 18627 16409 20845 15.7 13.8 17.6 6124 5231 7017 23.2 19.8 26.6 3765 3106 4424 19.8 16.3 23.3 51395 48709 54081 Skagit County WA est14_WA.txt 06NOV2015
53 59 1421 1099 1743 12.6 9.7 15.5 467 353 581 20.1 15.2 25.0 316 235 397 17.5 13.0 22.0 52673 47473 57873 Skamania County WA est14_WA.txt 06NOV2015
53 61 73930 66931 80929 9.9 9.0 10.8 22598 19490 25706 13.1 11.3 14.9 14401 12105 16697 11.5 9.7 13.3 71890 70201 73579 Snohomish County WA est14_WA.txt 06NOV2015
53 63 76910 70461 83359 16.3 14.9 17.7 21892 18858 24926 20.5 17.7 23.3 13976 11760 16192 18.2 15.3 21.1 50083 48190 51976 Spokane County WA est14_WA.txt 06NOV2015
53 65 8368 7255 9481 19.3 16.7 21.9 2668 2169 3167 28.2 22.9 33.5 1773 1413 2133 24.5 19.5 29.5 43823 40849 46797 Stevens County WA est14_WA.txt 06NOV2015
53 67 31197 27796 34598 11.9 10.6 13.2 9031 7502 10560 15.6 13.0 18.2 5706 4551 6861 13.7 10.9 16.5 61653 59047 64259 Thurston County WA est14_WA.txt 06NOV2015
53 69 558 431 685 13.9 10.7 17.1 184 141 227 26.7 20.4 33.0 130 98 162 24.3 18.3 30.3 51022 48377 53667 Wahkiakum County WA est14_WA.txt 06NOV2015
53 71 8682 7030 10334 15.7 12.7 18.7 2654 2046 3262 20.8 16.0 25.6 1762 1341 2183 19.1 14.6 23.6 49819 46459 53179 Walla Walla County WA est14_WA.txt 06NOV2015
53 73 31842 28461 35223 15.7 14.0 17.4 7304 6146 8462 17.7 14.9 20.5 4888 4054 5722 16.4 13.6 19.2 53733 51153 56313 Whatcom County WA est14_WA.txt 06NOV2015
53 75 11567 10634 12500 28.4 26.1 30.7 1181 938 1424 16.7 13.3 20.1 704 529 879 14.6 11.0 18.2 41837 37907 45767 Whitman County WA est14_WA.txt 06NOV2015
53 77 50044 45009 55079 20.5 18.4 22.6 22000 19457 24543 30.3 26.8 33.8 14492 12596 16388 28.0 24.3 31.7 44342 42101 46583 Yakima County WA est14_WA.txt 06NOV2015