zoukankan      html  css  js  c++  java
  • 学生成绩管理

    package 成绩统计;
    import java.util.Scanner;
    public class ScoreCensus {  
        
            private double  Math=0;
            private double  English=0;
            private double  Physical=0;
            public  void Input(int i)
            {
                  Scanner Sc=new Scanner(System.in);
                    System.out.print("输入第"+(i+1));
                    System.out.println("个学生的成绩信息:");
                    System.out.println("Math: ");
                    this.Math=Sc.nextDouble();
                    System.out.println("English: ");
                    this.English=Sc.nextDouble();
                    System.out.println("Physical: ");
                    this.Physical=Sc.nextDouble();
                
            }
            public double  Sum()
            {
                return (this.Math+this.English+this.Physical);
            }
            public double average()
            {
                double s;
                s=this.Sum()/3;
               return s;
            
            }
        public static void main(String[] args) {
            ScoreCensus s[]=new ScoreCensus[10];//使用对象数组要进行实例化,否则出现异常
            int i;
            for(i=0;i<s.length;i++)
            {
                s[i]=new ScoreCensus();//实例化
                s[i].Input(i);
                System.out.println(+s[i].Sum());
                System.out.println(+s[i].average());
                
            }
            
            
        }

    }

  • 相关阅读:
    用pyenv 和 virtualenv 搭建单机多版本python 虚拟开发环境
    如何快速地编写和运行一个属于自己的 MapReduce 例子程序
    Hive如何加载和导入HBase的数据
    kettle中的karaf设置
    sqoop学习
    windows 本地配置hadoop客户端
    python 随机分类
    python 皮尔森相关系数
    kettle配置命名参数
    idea配置scala和spark
  • 原文地址:https://www.cnblogs.com/xuannidaolao/p/9104267.html
Copyright © 2011-2022 走看看