MilaDimitrovaa

Students

Oct 17th, 2021
882
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Students { //начало на клас
  6.  
  7.     public String name;
  8.     public String surName;
  9.     public int groupNumber;
  10.  
  11.     Scores studentScore = new Scores();
  12.  
  13.     Scanner scan = new Scanner(System.in);
  14.  
  15.     public void setGrades(){
  16.         System.out.println("Please input Math grade:");
  17.         studentScore.setMathGrade(scan.nextFloat());
  18.         System.out.println("Please input Physics grade:");
  19.         studentScore.setPhysicsGrade(scan.nextFloat());
  20.         System.out.println("Please input Programing grade:");
  21.         studentScore.setProgrammingGrade(scan.nextFloat());
  22.  
  23.  
  24.     }
  25.  
  26.  
  27.   public Students(String name1, String surName1, int groupNumber1){ //Дефинираме конструктор с параметри
  28.       this.name = name1;
  29.       this.surName = surName1;
  30.       this.groupNumber = groupNumber1;
  31.   }
  32.  
  33.  
  34.     public void studentInfo(){
  35.         System.out.println();
  36.         System.out.println("Name : " + this.name );
  37.         System.out.println("Last name : " + this.surName);
  38.         System.out.println("Group : " + this.groupNumber);
  39.         System.out.println("Math grade : " + studentScore.getMathGrade());
  40.         System.out.println("Physics grade : " + studentScore.getPhysicsGrade());
  41.         System.out.println("Programming grade : " + studentScore.getProgrammingGrade() );
  42.         System.out.println("Average grade : " + studentScore.avgGrade());
  43.         System.out.println();
  44.     }
  45.  
  46. }// край на клас
RAW Paste Data