zoukankan      html  css  js  c++  java
  • 摄氏度和华氏度之间的额转换 Exercise06_08

     1 /**
     2  * @author 冰樱梦
     3  * 时间:2018年下半年
     4  * 题目:摄氏度和华氏度之间的额转换
     5  *
     6  */
     7 public class Exercise06_08 {
     8     public static void main(String[] args){
     9         System.out.printf("%-23s%-22s%-20s%-10s","摄氏度","华氏度","华氏度","摄氏度");
    10         System.out.println("
    ————————————————————————————————————————————————");
    11         for(double i=40,j=120;i>=31&&j>=30;i--,j-=10){
    12             System.out.printf("%-10.1f%-10.1f%-10.1f%.1f
    ",i,celsiusToFahrenheit(i),j,fahrenheitToCelsius(j));
    13         }
    14         
    15     }
    16     public static double celsiusToFahrenheit(double celsius){
    17         return (9.0/5)*celsius+32;
    18     }
    19     public static double fahrenheitToCelsius(double fahrenheit){
    20         return (5.0/9)*(fahrenheit-32);
    21     }
    22 }
  • 相关阅读:
    MARTIN FOWLER谈敏捷开发
    精益创业
    DEVOPS基础
    测试驱动开发
    持续集成(CONTINUOUS INTEGRATION)
    极限编程
    回归测试
    敏捷开发十二原则
    敏捷开发宣言
    敏捷开发简史
  • 原文地址:https://www.cnblogs.com/cherrydream/p/10173787.html
Copyright © 2011-2022 走看看