import javax.swing.JOptionPane;
public class FrostTemperature {
public static void main(String[] args){
double twc,ta,v;
String number;
number = JOptionPane.showInputDialog(null,"Enter the temperature in Fahrenheit between -58F and 41F");
ta = Double.parseDouble(number);
number = JOptionPane.showInputDialog(null,"Enter the wind speed (>= 2) in miles per hour:");
v = Double.parseDouble(number);
twc = 35.74 + 0.6215*ta - 35.75*Math.pow(v,0.16) + 0.4275*ta*Math.pow(v, 0.16);
int messageType=JOptionPane.INFORMATION_MESSAGE;
String message="The wind chill index is " + twc;
JOptionPane.showMessageDialog(null,message,"result",messageType);
}
}

Exercise02_17的更多相关文章

随机推荐

  1. handler更新ui线程的基本用法

    1.因为费时操作要放子线程,更新UI要放UI线程(主线程),所以子线程和主线程通信,通信的话要用到handler这个东西. 这里讲的比较简单,举2个例子说明 2.使用post的是handler ,使用 ...

  2. c++编辑器下载地址

    https://msdn.itellyou.cn/ 输入上述地址选中下图所示的按钮:

  3. 动态性能视图v$session_longops

    v$session_longops This view displays the status of various operations that run for longer than 6 sec ...

  4. RPC-整体概念

    RPC概述 RPC(Remote Procedure Call),即远程过程调用,是一种通过网络从远程计算机程序上请求服务而不需要了解底层网络技术的协议,实现调用远程主机上的方法就像调用本地方法一样. ...

  5. 【Foreign】最大割 [线性基]

    最大割 Time Limit: 15 Sec  Memory Limit: 256 MB Description Input Output Sample Input 3 6 1 2 1 1 2 1 3 ...

  6. bzoj1499: [NOI2005]瑰丽华尔兹&&codevs1748 单调队列优化dp

    这道题 网上题解还是很多很好的 强烈推荐黄学长 码风真的好看 神犇传送门 学习学习 算是道单调队列优化dp的裸题吧 #include<cstdio> #include<cstring ...

  7. bzoj 1601 最小生成树

    原题传送门http://www.lydsy.com/JudgeOnline/problem.php?id=1601 最小生成树的比较水的题,我们只需要加一个源点,连向所有的点,边权为每个点建水库的代价 ...

  8. 从setting文件导包

    两种方式 from project.settings.py import s3_key 第二种: from django.conf import setting s3_key = settings.S ...

  9. spring 声明式事务中try catch捕获异常

    原文:http://heroliuxun.iteye.com/blog/848122 今天遇到了一个这个问题 最近遇到这样的问题,使用spring时,在业务层需要捕获异常(特殊需要),当前一般情况下不 ...

  10. Centos安装流量监控工具iftop笔记

    Centos安装流量监控工具iftop笔记 一.概述 iftop可以用来监控网卡的实时流量(可以指定网段).反向解析IP.显示端口信息等,详细的将会在后面的使用参数中说明.官方网站:http://ww ...