(计算表达式)编写程序,显示以下公式的结果。
9.5×4.5-2.5×3
—————————————————
45.5-3.5
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package dome1_5;
/**
*
* @author Administrator
*/
public class Dome1_5 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
double calculate = 0.0;
calculate = (9.5 * 4.5 - 2.5 * 3) / (45.5 - 3.5);
System.out.println(calculate);
}
}