MilaDimitrovaa

Scores

Oct 17th, 2021
893
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.company;
  2.  
  3. public class Scores {
  4.  
  5.     public float mathGrade;
  6.     public float physicsGrade;
  7.     public float programmingGrade;
  8.    
  9.  
  10.     public void Grade(float math1, float physics1, float programming1){
  11.         this.mathGrade = math1;
  12.         this.physicsGrade = physics1;
  13.         this.programmingGrade = programming1;
  14.     }
  15.  
  16.     public float avgGrade(){
  17.  
  18.         float avgGradeForStudent;
  19.         avgGradeForStudent = ((this.mathGrade + this.physicsGrade + this.programmingGrade )/ 3);
  20.         return Math.round(avgGradeForStudent * (float)100) / (float)100;
  21.     }
  22.  
  23.     public float getMathGrade() {
  24.         return mathGrade;
  25.     }
  26.  
  27.     public void setMathGrade(float mathGrade) {
  28.         this.mathGrade = mathGrade;
  29.     }
  30.  
  31.     public float getPhysicsGrade() {
  32.         return physicsGrade;
  33.     }
  34.  
  35.     public void setPhysicsGrade(float physicsGrade) {
  36.         this.physicsGrade = physicsGrade;
  37.     }
  38.  
  39.     public float getProgrammingGrade() {
  40.         return programmingGrade;
  41.     }
  42.  
  43.     public void setProgrammingGrade(float programmingGrade) {
  44.         this.programmingGrade = programmingGrade;
  45.     }
  46.  
  47. }
  48.  
RAW Paste Data