Wait… Is It A Trap?

That is, the city knows what to expect from the new HQ in terms of it impacts on housing price and the property tax revenue.import csvsizeControl = 0.6a = 1030*sizeControlb = 1213*sizeControltractChosen = 0xCor = [475,100,300,400,300,300,400]yCor = [700,400,500,580,900,700,640]tractList = [103402,103501,103502,103503,103700,103601,103602]yearChosen = 0futurePrice = 0priceChange = 0hqScale = 40000tractChosen2 = 0def setup(): size(880,728) global crystalCity crystalCity = loadImage("Map1.jpg") def draw(): background(220) image(crystalCity,0,0,a,b) noStroke() textSize(15) for i in range(7): m = xCor[i] n = yCor[i] tract = tractList[i] fill(255) rect((m – 5)*sizeControl, (n – 15)*sizeControl, 65, 15) fill(255,0,0) text(tract, m*sizeControl, n*sizeControl) m = 630 n = 650 w = 1 for i in range(5): fill(63,68,71) rect(m,n,40,40) fill(200) text(w,m+15,n+25) w+=1 m+=50 overButton(mouseX, mouseY) textSize(14) fill(19,57,119) text("Census Tract Selection:", 630, 50) if tractChosen >1: text(tractChosen, 630, 90) else: text("No Selection", 630, 90) text( "Median Housing Value 2018:", 630, 180) houseValue = 0 if tractChosen == 103402: houseValue = 434000 elif tractChosen == 103501: houseValue = 348500 elif tractChosen == 103502: houseValue = 620100 elif tractChosen == 103503: houseValue = 588100 elif tractChosen == 103601: houseValue = 775600 elif tractChosen == 103602: houseValue = 775600 elif tractChosen == 103700: houseValue = 829700 averageValue = 624514 if tractChosen >1: text("$", 630, 220) text(houseValue, 638, 220) else: text("", 630, 220) houseValue1 = 0 if yearChosen == 1: text("Median Housing Value in Year:", 630, 310) fill(230, 83, 0) text(yearChosen, 803, 310) fill(19,57,119) text("$", 630, 350) houseValue1 = houseValue * (1.026 – 0.02368) text(houseValue1, 640, 350) priceChange = houseValue1 – houseValue text("Median Housing Value Change:", 630, 420) text("$", 630, 450) text(priceChange, 640, 450) averageHV = averageValue * (1.026 – 0.02368) text("Average Housing Value:", 630, 510) text("$", 630, 540) text(averageHV, 640, 540) elif yearChosen == 2: text("Median Housing Value in Year:", 630, 310) fill(230, 83, 0) text(yearChosen, 803, 310) fill(19,57,119) text("$", 630, 350) houseValue1 = houseValue * (1.003 + 0.021)* (1.026 – 0.02368) text(houseValue1, 640, 350) priceChange = houseValue1 – houseValue text("Median Housing Value Change:", 630, 420) text("$", 630, 450) text(priceChange, 640, 450) averageHV = averageValue * (1.003 + 0.021)* (1.026 – 0.02368) text("Average Housing Value:", 630, 510) text("$", 630, 540) text(averageHV, 640, 540) elif yearChosen == 3: text("Median Housing Value in Year:", 630, 310) fill(230, 83, 0) text(yearChosen, 803, 310) fill(19,57,119) text("$", 630, 350) houseValue1 = houseValue * (1.016 + 0.0194) * (1.003 + 0.021) * (1.026 – 0.02368) text(houseValue1, 640, 350) priceChange = houseValue1 – houseValue text("Median Housing Value Change:", 630, 420) text("$", 630, 450) text(priceChange, 640, 450) averageHV = averageValue * (1.003 + 0.021) * (1.026 – 0.02368) * (1.016 + 0.0194) text("Average Housing Value:", 630, 510) text("$", 630, 540) text(averageHV, 640, 540) elif yearChosen == 4: text("Median Housing Value in Year:", 630, 310) fill(230, 83, 0) text(yearChosen, 803, 310) fill(19,57,119) text("$", 630, 350) houseValue1 = houseValue * (1.025 – 0.0042)* (1.016 + 0.0194) * (1.003 + 0.021) * (1.026 – 0.02368) text(houseValue1, 640, 350) priceChange = houseValue1 – houseValue text("Median Housing Value Change:", 630, 420) text("$", 630, 450) text(priceChange, 640, 450) averageHV = averageValue * (1.003 + 0.021) * (1.026 – 0.02368) * (1.016 + 0.0194) * (1.025 – 0.0042) text("Average Housing Value:", 630, 510) text("$", 630, 540) text(averageHV, 640, 540) elif yearChosen == 5: text("Median Housing Value in Year:", 630, 310) fill(230, 83, 0) text(yearChosen, 803, 310) fill(19,57,119) text("$", 630, 350) houseValue1 = houseValue * (1.093 – 0.0196)* (1.025 – 0.0042) * (1.016 + 0.0194) * (1.003 + 0.021) * (1.026 – 0.02368) text(houseValue1, 640, 350) priceChange = houseValue1 – houseValue text("Median Housing Value Change:", 630, 420) text("$", 630, 450) text(priceChange, 640, 450) averageHV = averageValue * (1.003 + 0.021) * (1.026 – 0.02368) * (1.016 + 0.0194) * (1.025 – 0.0042) * (1.093 – 0.0196) text("Average Housing Value:", 630, 510) text("$", 630, 540) text(averageHV, 640, 540) text("Years From Now:", 630, 630) #if ##### PUT THE STRUCTURE HERE##### when the user click the tract label ("tractChosen" is the tract's mane) def mousePressed(): global tractChosen, yearChosen # tractChosen = 0 yearChosen = 0 if overSelection > 600: tractChosen = overSelection if overSelection > 0 and overSelection < 100: yearChosen = overSelection # global tractChosen2 # tractChosen2 = 1 # if overSelection2 > 0: # tractChosen2 = overSelection2 def overButton(x, y): global overSelection overSelection = 0 for i in range(7): m = xCor[i] *sizeControl n = yCor[i] *sizeControl if m <= x <= m + 65 and n-15 <= y <= n: overSelection = tractList[i] if y >650 and y < 690: if x >630 and x < 670: overSelection = 1 elif x >680 and x < 720: overSelection = 2 elif x > 730 and x < 770: overSelection = 3 elif x > 780 and x < 820: overSelection = 4 elif x > 830 and x < 870: overSelection = 5. More details

Leave a Reply