qq_35396496
qq_35396496
2017-09-06 13:34

求助大神 这个Java程序出现下图这样的情况

  • java

package tom.jiafei;
class Lader{
double upbottom,lobottom,height;
Lader(double a,double b,double c){
upbottom=a;
lobottom=b;
height=c;}
public double f(){
return (upbottom+lobottom)*height/2;}}
class Circle{
double radiues;
Circle(double a){
radiues=a;}
public double getArae(){
return 3.14*radiues*radiues;}
public double getLenght(){
return 3.14*2*radiues;}}

import tom.jiafei.*;
public class getLaderAndCircle{
public static void main(String args[]){
Lader l=new Lader(3,5,6);
Circle c=new Circle(3.5);
System.out.printf("圆的面积为%f",c.getArae());
System.out.printf("圆的周长为%f",c.getLenght());
System.out.printf("梯形的面积为%f",l.f());}}图片

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

6条回答