Question: This is IntelliJ java. I have these codes, but I am getting a good result. Please them and assist me. This is the ket.txt =

This is IntelliJ java. I have these codes, but I am getting a good result. Please them and assist me.

This is the ket.txt = AIzaSyBqAZ-5zQLdifYl1y89DQjtyPBzXyqKdPU

package Mohamed.company; import com.google.maps.ElevationApi; import com.google.maps.GeoApiContext; import com.google.maps.GeocodingApi; import com.google.maps.model.ElevationResult; import com.google.maps.model.GeocodingResult; import com.google.maps.model.LatLng; import java.awt.image.BufferedImage; import java.io.BufferedReader; import java.io.FileReader; import java.util.Scanner; /**  * Created by mash4 on 3/7/2017.  */ public class googel_map { static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { String key = null; try{ BufferedReader reader = new BufferedReader(new FileReader("key.txt")); key = reader.readLine(); } catch (Exception ioe){ System.out.println("No key found, or could n't read key. Please verify key.txt present "); System.exit(-1); } System.out.println("Please enter an address : "); GeoApiContext context = new GeoApiContext().setApiKey(key); String myAdrress = sc.nextLine(); GeocodingResult result [] = GeocodingApi.geocode(context, myAdrress).await(); LatLng r = (result[0].geometry.location); ElevationResult [] t = ElevationApi.getByPoints(context, r).await(); if(result.length >= 1){ ElevationResult addElevation = t[0]; System.out.println("The elevation of " + myAdrress + " above sea level is " + addElevation.elevation + " meters."); } } } 

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!