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

    public class Grade {
        private
                   double english;
         double math;
        double Chinese;
         
        public:
                  Grade(double english, double math, double Chinese)
         {
            this.english = english;
            this.math = math;
            this.Chinese = Chinese;
        }
     
         double sum() 
        {
            return this.english+this.math+this.Chinese;
        }
         
         void displayTotal() 
        {
            System.out.println(sum());
        }
         
         double average() 
        {
            return total()/3;
        }
         
         void displayAverage() 
        {
            System.out.println(average());
        }
         double getEnglish() 
        {
            return english;
        }
     
         void setEnglish(double english)
         {
            this.english = english;
        }
     
        double getMath()
         {
            return math;
        }
     
        void setMath(double math)
         {
            this.math = math;
        }
     
        public double getChinese() 
         {
            return Chinese;
        }
     
        public void setChinese(double Chinese) {
            this.Chinese = Chinese;
        }
    }
    public class Student {
        String name;
        Grade grade;
        public Student(String name, Grade grade) {
            this.name = name;
            this.grade = grade;
        }
         
    public static void main(String[] args) 
    {
            Student s = new Student("Cici"new Grade(708090));
            s.grade.printAverage();
            s.grade.printTotal();
        }
    }
  • 相关阅读:
    Python matplotlib基本设置
    Python可视化工具
    使用Python进行数据分析——常见实用的第三方库
    Python第三方库安装
    Python pip的安装
    Python cx_Oracle数据库连接
    Python安装使用(WinXP)
    大数据学习路线(转载)
    SQL 数据库学习之路-转自大神笔记
    Java字符串处理函数汇总
  • 原文地址:https://www.cnblogs.com/xxym/p/9101945.html
Copyright © 2011-2022 走看看