Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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: o The distance of a Manhattan city block running from one street to the next street is on average 1/20th of a mile (0.05 mile). o The distance of a Manhattan city block running from one avenue to the next avenue is on average 3/20th of mile (0.15 mile). Based on these block length estimates, the distance from the corner at street s1 and avenue a1 to the corner of street S2 and avenue a2 IS (005 |s1-52 l ) + ( 0.15 a1-a21) . If you do not remember I's from algebra, s1- s2 l is the absolute value of s1 s2 and a1 a2 l is the absolute value of a1- a2 Python built-in function abs0 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. We will demonstrate how to do this in class. Two different sample runs Starting corner (street and avenue): 596 Ending corner (street and avenue): 34 7 Starting corner (street and avenue): 47 2 Ending corner (street and avenue): 238 6 10.15

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

7. Finalist companies make their presentations.

Answered: 1 week ago

Question

Identify and control your anxieties

Answered: 1 week ago

Question

Understanding and Addressing Anxiety

Answered: 1 week ago