## Assignment 8 — multi-input problem solving

## Due Wednesday, January 31

### Downloads

### Program `manhattan_distance.py`

- The program takes as its integer input, the street and avenue of one corner in Manhattan and the street and avenue of another corner in Manhattan. The program then computes an estimate of the distance between the two locations using the above formula. The only program output besides the prompts is the estimate.

- Note: the program is to make only two prompts for data, each with two inputs on a single line, as demonstrated in the sample runs below.

- New Yorkers approximate distance between two Manhattan locations using the number of streets and avenues separating the starting and ending locations.

- The approximation uses the following estimates.

- The distance of a Manhattan city block running from one street to the next street is on average 1/20
^{th}of a mile.

- The distance of a Manhattan city block running from one avenue to the next avenue is on average 3/20
^{th}of mile.

- Based on these block length estimates, the distance from the corner at street s
_{1}and avenue a_{1}to the corner of street s_{2}and avenue a_{2}is

( 0.05 × | s

_{1}– s_{2}| ) + ( 0.15 × | a_{1}– a_{2}| )

- If you do not remember | |’s from high school algebra, | s
_{1}– s_{2}| is the absolute value of s_{1}– s_{2}and | a_{1}– a_{2}| is the absolute value of a_{1}– a_{2}.

- Python built-in function abs() computes absolute values. It is
*important to calculate**the absolute values of the street differences and avenue differences*.*separately*

- Because both input prompts should cause the user to supply two values, string function
`split()`

should prove helpful. See string documentation for information on`split()`

or post-class example break_the_bank.py

#### Two different sample runs

Starting corner (street and avenue): 59 6

Ending corner (street and avenue): 34 7

1.4

Starting corner (street and avenue): 47 2

Ending corner (street and avenue): 238 6

10.15