zhouxiaoyue
package gh;
class xs{
    //成员变量
    int xh;
 String xm;
    int sx;
    int yw;
    int yy;
    
    //构造方法
    xs(int xh1,String xm1,int sx1,int yw1,int yy1)
    {
        xh=xh1;
        xm=xm1;
        sx=sx1;
        yw=yw1;
        yy=yy1;
    }
    
    //成员方法
    int ave()
    {
        int result;
        result = (sx+yw+yy)/3;
        return result;
                
    }
}
public class xsgj {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        int avescore;
        xs xs1 = new xs(119509228,"周月",100,90,89);
        avescore=xs1.ave();
        System.out.println("平均成绩"+avescore);
    }

}

 

分类:

技术点:

相关文章:

  • 2021-12-17
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
猜你喜欢
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案