shnurg / week2-homework

Week 2 Homework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Homework Instructions

DUE: Monday, January 20, 11:59PM

Fork this repository to your github account and clone it down to your local computer. Refer to the week 1 homework for step-by-step instructions on forking and cloning here.

Refer to the week 2 class repository code for hints.

For this assignment, you will be editing the directions.rb, geolocate.rb and weather.rb files located in this repository. Each Ruby script should provide a user for input and return a specific output. Your a Ruby scripts should do the following:

geolocate.rb

A user should be provided with an input prompt. A user can enter any full street address (street number, street name, street suffix, city, state, zip code) and the program should return latitude and longitude coordinates.

Use the Google Geocoding JSON API to convert the address to latitude and longitude.

Example:

directions.rb

A user should be provided with two input prompts. A user can enter any origin address and any destination address. The program should return the total traveling distance in miles and the total travel time in hours and minutes.

Use the the Google Directions JSON API to retrieve travel data.

Example:

weather.rb

A user should be provided with an input prompt. A user can enter any address and the program should return the temperature in Fahrenheit.

Use the OpenWeatherMap JSON API to pull weather data based on the user input.

Example:

Grading

Your code will be judged on the user input and output, retrieving API data and accessing the API response.

Good luck!

About

Week 2 Homework