Advertisement
TsetsoP

Scores

Oct 11th, 2021
1,680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. public class Scores {
  2.      public float maths;
  3.      public float physics;
  4.      public float programming;
  5.  
  6.     public Scores(float maths, float physics, float programming) {
  7.         this.maths = maths;
  8.         this.physics = physics;
  9.         this.programming = programming;
  10.     }
  11.  
  12.     public float Average(){
  13.         float Avg;
  14.         Avg = (this.maths + this.physics + this.programming) / 3;
  15.         return Avg;
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement