Exercise02_17
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的更多相关文章
随机推荐
- PropertiesConfiguration的用法
PropertiesConfiguration是一个配置文件的加载工具类,封装了从配置文件里获取值并转化为基本数据类型的方法. 使用org.apache.commons.configuration2中 ...
- hive 动态分区(Dynamic Partition)异常处理
Changing Hive Dynamic Partition Limits Symptoms: Hive enforces limits on the number of dynamic parti ...
- CSS学习之float解析
转自:http://www.w3cplus.com/css/float.html 一.float是什么? float即为浮动,在CSS中的作用是使元素脱离正常的文档流并使其移动到其父元素的“最左边”或 ...
- React 开发常见报错解决方法
1. 使用 redux 的异步 action 时浏览器报错: Error: Actions must be plain objects. Use custom middleware for async ...
- 【Foreign】无聊的计算姬 [Lucas][BSGS]
无聊的计算姬 Time Limit: 10 Sec Memory Limit: 256 MB Description Input Output Sample Input 6 2 2 3 4 3 2 ...
- loj6029 「雅礼集训 2017 Day1」市场
传送门:https://loj.ac/problem/6029 [题解] 考虑如果有一些近似连续的段 比如 2 2 2 3 3 3,考虑在除3意义下,变成0 0 0 1 1 1,相当于整体-2 又:区 ...
- 【BZOJ】1770 [Usaco2009 Nov]lights 燈
[算法]高斯消元-异或方程组 [题解]良心简中题意 首先开关顺序没有意义. 然后就是每个点选或不选使得最后得到全部灯开启. 也就是我们需要一种确定的方案,这种方案使每盏灯都是开启的. 异或中1可以完美 ...
- [bzoj3994][SDOI2015]约数个数和-数论
Brief Description 计算\(\sum_{i\leqslant n}\sum_{j\leqslant m}\sigma_0(ij)\). Algorithm Design 首先证明一个结 ...
- python2.7字典转换成json时中文字符串变成unicode的问题:
参考:http://blog.csdn.net/u014431852/article/details/53058951 编码问题: python2.7字典转换成json时中文字符串变成unicode的 ...
- appium===Appium的前世今生
一.什么是Appium Appium是一个开源.跨平台的测试框架,可以用来测试原生及混合的移动端应用.Appium支持IOS.Android及FirefoxOS平台.Appium使用WebDriv ...