Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace PrIn_LabRab5
  8. {
  9.     public class Student : Person
  10.     {
  11.         /*Успеваемость в процентах, от 0 до 100*/
  12.         private const float theWorst = 0f;
  13.         private const float theBest = 100f;
  14.         private float performance;
  15.         public Student(string firstName, string secondName, float performance, int dayOfBirth = -1, int monthOfBirth = -1, int yearOfBirth = -1) : base(firstName, secondName, dayOfBirth, monthOfBirth, yearOfBirth)
  16.         {
  17.             if (performance < 0)
  18.             {
  19.                 this.performance = theWorst;
  20.             }
  21.             else if (performance >= 100)
  22.             {
  23.                 this.performance = theBest;
  24.             }
  25.             else
  26.             {
  27.                 this.performance = performance;
  28.             }
  29.            
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement