java语言程序设计(基础篇)第十版编程练习题[1.8]
2019-01-04 11:09
537 查看
(圆的面积和周长)编写程序,使用以下公式计算并显示半径为5.5的圆的面积和周长。
周长 = 2 × 半径 × π 面积 = 半径 × 半径 × π
/* * 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_8; /** * * @author Administrator */ public class Dome1_8 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here double radius = 5.5;//半径 double pi = 3.14; System.out.println("周长:" + (2 * radius * pi)); System.out.println("面积:" + (radius * radius * pi)); } }
相关文章推荐
- java语言程序设计(基础篇)第十版编程练习题[2.12]
- java语言程序设计(基础篇)第十版编程练习题[2.13]
- java语言程序设计(基础篇)第十版编程练习题[2.14]
- java语言程序设计(基础篇)第十版编程练习题[1.12]
- java语言程序设计(基础篇)第十版编程练习题[2.15]
- java语言程序设计(基础篇)第十版编程练习题[1.9]
- java语言程序设计(基础篇)第十版编程练习题[1.13]
- java语言程序设计(基础篇)第十版编程练习题[2.16]
- java语言程序设计(基础篇)第十版编程练习题[2.20]
- java语言程序设计(基础篇)第十版编程练习题[2.1]
- java语言程序设计(基础篇)第十版编程练习题[2.17]
- java语言程序设计(基础篇)第十版编程练习题[2.21]
- java语言程序设计(基础篇)第十版编程练习题[1.10]
- java语言程序设计(基础篇)第十版编程练习题[2.2]
- java语言程序设计(基础篇)第十版编程练习题[2.18]
- java语言程序设计(基础篇)第十版编程练习题[2.3]
- java语言程序设计(基础篇)第十版编程练习题[2.19]
- java语言程序设计(基础篇)第十版编程练习题[2.4]
- java语言程序设计(基础篇)第十版编程练习题[2.5]
- java语言程序设计(基础篇)第十版编程练习题[2.6]