Python code Your friends in the Computer Science department have been complaining to you that DC is confusing to get around. Due to the high cost of their mobile plan’s data rates, they can’t use map programs like Apple Maps or Google Maps. They’ve asked you to build a program that tells users where in DC they are compared to some landmarks that they know. Your task is to build a program which tells user’s their relative location to some set places. You should: Use the table below as reference: Place Latitude, Longitude K St (Runs east to west) 38.902649 The White House 38.897789, -77.036562 Downing Hall 38.921669, -77.021361 Dupont Circle 38.909760, -77.043479 Union Station 38.897698, -77.007200 Your code should look like this (user input is for Greene Stadium and is in ): Insert your latitude: Insert your longitude: You are north of K St You are north of the White House You are east of the White House You are north of Downing Hall You are west of Downing Hall You are north of Dupont Circle You are east of Dupont Circle You are north of Union Station You are west of Union Station

In order to build a program that tells users their relative location to various landmarks in Washington, D.C., we can follow a step-by-step approach using Python. We will use latitude and longitude coordinates to determine the user’s location in relation to the landmarks provided in the table.

To start, we will define the coordinates of the landmarks as variables in our code. The latitude and longitude values for each landmark are as follows:

K St (Runs east to west): 38.902649
The White House: 38.897789, -77.036562
Downing Hall: 38.921669, -77.021361
Dupont Circle: 38.909760, -77.043479
Union Station: 38.897698, -77.007200

Next, we will prompt the user to input their latitude and longitude coordinates. This can be done using the `input()` function in Python. We will store the user’s input in variables called `user_latitude` and `user_longitude`.

Once we have the user’s coordinates, we can compare them to the landmarks to determine their relative location. We will perform a series of conditional statements to determine the user’s position in relation to each landmark.

For example, to determine if the user is north of K St, we can compare their latitude to the latitude of K St. If the user’s latitude is greater than the latitude of K St, we can print the message “You are north of K St”. Similarly, we can use conditional statements to determine if the user is north, east, west, or south of each landmark.

Here is an example of how the code would look like:

“`python
# Define the coordinates of the landmarks
k_st_latitude = 38.902649
the_white_house_latitude = 38.897789
the_white_house_longitude = -77.036562
downing_hall_latitude = 38.921669
downing_hall_longitude = -77.021361
dupont_circle_latitude = 38.909760
dupont_circle_longitude = -77.043479
union_station_latitude = 38.897698
union_station_longitude = -77.007200

# Prompt the user for their latitude and longitude
user_latitude = float(input(“Insert your latitude: “))
user_longitude = float(input(“Insert your longitude: “))

# Compare the user’s coordinates with the landmarks
if user_latitude > k_st_latitude:
print(“You are north of K St”)
else:
print(“You are south of K St”)

if user_latitude > the_white_house_latitude:
print(“You are north of the White House”)
else:
print(“You are south of the White House”)

if user_longitude > the_white_house_longitude:
print(“You are east of the White House”)
else:
print(“You are west of the White House”)

# Repeat the same conditional statements for the other landmarks

“`

By running this code, users will be able to input their latitude and longitude, and the program will display their relative location in relation to each landmark. The program can be expanded to include additional landmarks or modified to suit your specific needs.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer