标题:问题:计算风寒湿度(要求风速必须>=2,华氏度在-58度至41度之间)
只看楼主
bug娃娃
Rank: 2
等 级:论坛游民
帖 子:101
专家分:27
注 册:2019-3-15
结帖率:95.24%
已结贴  问题点数:20 回复次数:2 
问题:计算风寒湿度(要求风速必须>=2,华氏度在-58度至41度之间)

package homeWork;
import java.util.Scanner;

public class T0822 {
   
    public static void main(String[] args) {   
            Scanner input = new Scanner(System.in);
            //prompt the user to enter the fahrenheit and wind chill index
            System.out.print("Enter the tempreture in fahrenheit between -58 °F and 41 °F:");
            double tempreture = input.nextDouble();
            
            System.out.print("Enter the wind speed miles per hour(must be greater than or equal to 2:");
            double windChill = input.nextDouble();
            
            if(tempreture >= (-58) && tempreture <= 41 && windChill >= 2) {
                  //T是风寒温度
                  double T = 35.74 + 0.6215 * Math.pow(windChill, 0.16) + 0.4275 * Math.pow(tempreture,0.16);
                  System.out.println("The wind chill index is " + T);           
            }
            else
                System.out.println("Can't run");
            
            input.close();                    
        }
}
出现了这种状况,请教大家,这是什么?

搜索更多相关主题的帖子: input System the enter out 
2019-05-01 17:01
rind
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:49
专家分:368
注 册:2018-3-8
得分:20 
Reason:后面就是原因,复制然后打开谷歌翻译。

保存为GBK编码的文件发现有没有对应编码的字符。

仅供参考,欢迎指正
2019-05-01 18:36
bug娃娃
Rank: 2
等 级:论坛游民
帖 子:101
专家分:27
注 册:2019-3-15
得分:0 
喔喔,这个还需要英语很好呢
2019-05-02 15:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-494492-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.487467 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved