Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class weatherproject {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in); //System.in = system input
- String city;
- String state;
- String j;
- System.out.println("Enter a city: ");
- city = in.nextLine();
- city = city.replaceAll(" ", "_");
- System.out.println("Enter a state's initials: ");
- state = in.nextLine();
- j = "http://api.wunderground.com/api//conditions/q/" + city + "/" + state + ".json";
- city = city.replaceAll("_", " ");
- System.out.println("You entered: " + "'" + city + ", " + state + "'");
- System.out.println("The url to be called is " + j);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement