Question: Use PYCHARM 2020: Problem: A road map defines locations as map references like B3, where B is the x-coordinate value and 3 is the y-coordinate.

Use PYCHARM 2020:

Use PYCHARM 2020: Problem: A road map defines locations as map references

like B3, where B is the x-coordinate value and 3 is the

Problem: A road map defines locations as map references like B3, where B is the x-coordinate value and 3 is the y-coordinate. A B C D E F . Y Z 1 E2 2 3 B3 4 5 01 6 : 25 Y25 26 The grid lines are 0.5 km apart. Write a program that allows the user to enter a trip as a sequence of any number of map references on one line, and reports the total length of the trip, assuming they can travel in straight lines. For example: Enter trip map references: C2 B5 Y25 Total distance = 16.8 km For badly formatted map references, your program should exit, reporting the first bad map reference. Enter trip map references: E6 E4 D7 d43 F5 Bad reference: 043 Enter trip map references: D2 F23 Ja E23 Z2 Bad reference: Hints: You need to split the input line into separate references; each reference starts with one character which must be an upper case letter, and the rest must be only digits; and Pythagoras will help. The function exit() can abort the program if you detect an error in the input

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!