Advertisement
Guest User

zad3

a guest
Mar 4th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. namespace zad3
  2. {
  3.  
  4.  
  5. class Student
  6. {
  7. string nazwisko;
  8. string imie;
  9. int numerAlbumu;
  10. int semestr;
  11. public Student(string nazwisko, string imie, int numerAlbumu)
  12. {
  13. this.nazwisko = nazwisko;
  14. this.imie = imie;
  15. this.numerAlbumu = numerAlbumu;
  16. semestr =1;
  17. }
  18. public void Wyświetl()
  19. {
  20. if ( semestr < 8)
  21. {
  22. Console.WriteLine(" Student {0}, {1}, semestr: {2}, numer albumu {3}",imie, nazwisko, numerAlbumu, semestr);
  23. }
  24. else
  25. {
  26. Console.WriteLine("Absolwent: {0}, {1}", imie, nazwisko);
  27. }
  28. }
  29. public void Promocja()
  30. {
  31. if (semestr < 8)
  32. {
  33. semestr++;
  34. }
  35.  
  36. }
  37.  
  38.  
  39.  
  40. }
  41. class Program
  42. {
  43. static void Main(string[] args)
  44. {
  45. Student s1 = new Student( "Kowalski","Jan", 654 );
  46. s1.Wyświetl();
  47. s1.Promocja();
  48. s1.Wyświetl();
  49. s1.Promocja();
  50. s1.Wyświetl();
  51. s1.Promocja();
  52. s1.Wyświetl();
  53. s1.Promocja();
  54. s1.Wyświetl();
  55. s1.Promocja();
  56.  
  57. s1.Wyświetl();
  58. s1.Promocja();
  59.  
  60.  
  61. Console.ReadKey();
  62.  
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement