未完成

package jihe;
import java .util.*;
import java.awt.geom.Area;
import java .lang.*;
import java.util.Scanner; 
public class Jihe{
int a;/*基本几何图形的边长*/
int b;/*基本几何图形的边长*/
double r;/*圆半径*/
int c;/*基本几何图形的边长*/
public Jihe() {
this.a = a;
this.b = b;
this.c = c;
this.r = r;
}/*利用构造函数初始化成员字段*/
}
public class Triangle extends Jihe{
super(a,b,c);
public  double Area() {
double S;
double p;
p=(a+b+c)/2;
S=Math.sqrt(p*(p-a)*(p-b)*(p-c));
return S;
}
public int Zhouchang(){
int C;
C=a+b+c;
return C;
}
}
public class Circle extends Jihe{
super.r=r;
public double Area() {
double S;
S=Math.PI*r*r;
}
public double Zhouchang() {
double C;
C=Math.PI*2*r;
        return C;
}
}
public class Rectangle  extends Jihe{
super(a,b);
public int Area() {
int S;
S= a*b;
return S;
}
public int Zhouchang(){
int C;
C=2*(a+b);
return C;
}
}


public class Test {
public static void main(String[] args) {
System.out.println("请选择要计算的基本图形/n1、三角形。2、圆形3、矩形");
int choose;
Scanner sc =new Scanner(System.in); 
choose =sc.nextInt();
switch(choose){
       case 1:System.out.println("请输入三角形的三边");
       Jihe J = new Jihe();
       Scanner qw =new Scanner(System.in); 
       int a,b,c;
       a = qw.nextInt();
       b = qw.nextInt();
       c = qw.nextInt();
Triangle T= new Triangle(a,b,c);
System.out.println(S"+"C);

}
}
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值