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
program re-prompts user for state until wa, ca, or q is entered
kedevlin committed Apr 8, 2016
commit 6501cec0068ee9aa218846bdaa562b04232fbdc4
18 changes: 10 additions & 8 deletions poverty/program.py
Original file line number Diff line number Diff line change
@@ -73,13 +73,15 @@ def print_county(file_name):
print "Median household income: " + lowest_wa_county.med_income
print "***************************************************************"
print ""
state = raw_input("Enter 'CA' for California, 'WA' for Washington, or 'q' to quit: ").upper()
if (state == "WA"):
file_name = "washington.txt"
elif (state == "CA"):
file_name = "california.txt"
elif (state == "Q"):
print "BYE."
quit()
file_name = None
while (file_name is None):
state = raw_input("Enter 'CA' for California, 'WA' for Washington, or 'q' to quit: ").upper()
if (state == "WA"):
file_name = "washington.txt"
elif (state == "CA"):
file_name = "california.txt"
elif (state == "Q"):
print "BYE."
quit()

print_county(file_name)