package com.imooc.weather;
import com.imooc.weather.impl.WeatherUtilsImpl;
import java.util.List;
import java.util.Scanner;
public class Application {
public static void main(String[] args) {
System.out.println("查询最近天气预报:");
System.out.println("输入1:查询未来24小时天气预报:");
System.out.println("输入2:查询未来3天天气预报");
System.out.println("输入3:查询未来7天天气预报");
System.out.print("请输入您的选择:");
Scanner scanner = new Scanner(System.in);
int i = scanner.nextInt();
System.out.println("用户输入数字:" + i);
if (i==1){
System.out.print("请输入城市名称查询未来24小时天气预报:");
String city = scanner.next();
WeatherUtils weatherUtils = new WeatherUtilsImpl();
List<HourWeather> weatherList = weatherUtils.w24h("API",city);//API输入自己的api应用程序编程接口,这里就不提
java第十六次作业 预测天气预报
最新推荐文章于 2023-03-06 13:53:47 发布