Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

image text in transcribed

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

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

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions

Question

=+2. Why is due process important?

Answered: 1 week ago