Advertisement
TsetsoP

Utility

Oct 12th, 2021
979
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.18 KB | None | 0 0
  1. public class Utility {
  2.     public static void utilities() {
  3.         Students tsvetomir = new Students("Tsvetomir", "Mutashki", 18227);
  4.         Students petko = new Students("Petko", "Stoev", 18520);
  5.         Students alex = new Students("Alex", "Tsvetanov", 18201);
  6.         Students vladi = new Students("Vladislav", "Dimitrov", 18209);
  7.         Students stilyan = new Students("Stilyan", "Stoev", 18525);
  8.  
  9.         Scores score1 = new Scores(6, 5, 4.50f);
  10.         Scores score2 = new Scores(3.50f, 4, 3.50f);
  11.         Scores score3 = new Scores(6, 5.50f, 6);
  12.         Scores score4 = new Scores(4.50f, 4.30f, 5);
  13.         Scores score5 = new Scores(4.50f, 3.50f, 4);
  14.  
  15.         tsvetomir.studentsInfo();
  16.         System.out.printf("Maths: %.2f" + "\n", score1.maths);
  17.         System.out.printf("Physics: %.2f" + "\n", score1.physics);
  18.         System.out.printf("Programming: %.2f" +"\n", score1.programming);
  19.         System.out.printf("Avg = %.2f" + "\n" , score1.Average());
  20.  
  21.         petko.studentsInfo();
  22.         System.out.printf("Maths: %.2f" + "\n", score2.maths);
  23.         System.out.printf("Physics: %.2f" + "\n", score2.physics);
  24.         System.out.printf("Programming: %.2f" +"\n", score2.programming);
  25.         System.out.printf("Avg = %.2f" + "\n" , score2.Average());
  26.  
  27.         alex.studentsInfo();
  28.         System.out.printf("Maths: %.2f" +"\n", score3.maths);
  29.         System.out.printf("Physics: %.2f" +"\n", score3.physics);
  30.         System.out.printf("Programming: %.2f" +"\n", score3.programming);
  31.         System.out.printf("Avg = %.2f" + "\n" , + score3.Average());
  32.  
  33.         vladi.studentsInfo();
  34.         System.out.printf("Maths: %.2f" + "\n", score4.maths);
  35.         System.out.printf("Physics: %.2f" + "\n", score4.physics);
  36.         System.out.printf("Programming: %.2f" + "\n", score4.programming);
  37.         System.out.printf("Avg = %.2f" + "\n" , +score4.Average());
  38.  
  39.         stilyan.studentsInfo();
  40.         System.out.printf("Maths: %.2f" + "\n", score5.maths);
  41.         System.out.printf("Physics: %.2f" + "\n", score5.physics);
  42.         System.out.printf("Programming: %.2f" + "\n", score5.programming);
  43.         System.out.printf("Avg = %.2f" + "\n",  score5.Average());
  44.     }
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement