Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program must give them the option and I will test both. For city you should ask the user to enter a state, otherwise, there's

The program must give them the option and I will test both.  For city you should ask the user to enter a state, otherwise, there's no way to distinguish between Omaha TX, Omaha AR, and Omaha NE.

  1. Validate whether the user entered valid data. If valid data isn't presented notify the user. Your program should never crash with bad user input
  • request weather forecast data from OpenWeatherMap.
    1. Use the Requests library in order to request data from the web service.
    2. Make a connection to the API using the Requests library.
    3. Use Try blocks to ensure that your request was successful. If the connection was not successful display a message to the user.
    4. Use try blocks when establishing connections to the web service. You must print a message to the user indicating whether or not the connection was successful.
    5. ask the user which they want to perform with each iteration of the program.
        1.  

       Display the weather information in a READABLE format to the user  in Celsius and Fahrenheit

      1. Allow the user to run the program multiple times to allow them to look up weather conditions for multiple locations.
      • must GEO Lookup first then weather lookup using the latitude and longitude. This will require you to do 2 API calls. One call will be to obtain the LAT and LON and the other will be to get the weather using the LAT and LON.
      • READ all of the OpenWeather GEOCode and Weather Lookup API documentation.  Most of the questions you have can be answered by the API documentation.
      •  

      API Key http://openweathermap.org/appid

      My key: 89dac574b137de87ab6b6a6f026019e0

Step by Step Solution

3.47 Rating (154 Votes )

There are 3 Steps involved in it

Step: 1

Answer Below is the Python code implementing the described functionality import requests def getweat... 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Operating System questions