Danielos168

Zadanie 2 26-02

Feb 26th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.43 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 Zadanie2
  8. {
  9.     class Student
  10.     {
  11.        public string nazwisko;
  12.         public string imie;
  13.         public int nr_albumu;
  14.         public int semestr;
  15.  
  16.         public Student(string nazwisko, string imie, int nr_albumu, int semestr)
  17.         {
  18.             this.nazwisko = nazwisko;
  19.             this.imie = imie;
  20.             this.nr_albumu = nr_albumu;
  21.             this.semestr = semestr;
  22.         }
  23.         public void zmien_nazwisko(string nowe_nazwisko)
  24.         {
  25.             nazwisko = nowe_nazwisko;
  26.         }
  27.         public void zmien_imie(string nowe_imie)
  28.         {
  29.             imie = nowe_imie;
  30.         }
  31.         public void zmien_nr_albumu(int nowe_nr_albumu)
  32.         {
  33.             nr_albumu = nowe_nr_albumu;
  34.         }
  35.         public void zmien_semestr(int nowe_semestr)
  36.         {
  37.             semestr = nowe_semestr;
  38.         }
  39.  
  40.         public void wyswietl()
  41.         {
  42.             Console.WriteLine("Student {0} {1} o numerze albumu {2} uczęszcza na zajecia semestru {3}",nazwisko,imie,nr_albumu,semestr);
  43.         }
  44.         public void zmien_semestr()
  45.         {
  46.             semestr = semestr + 1;
  47.         }
  48.  
  49.     }
  50.     class Program
  51.     {
  52.         static void Main(string[] args)
  53.         {
  54.             Student s1 = new Student("Kowalski", "Jan", 2333, 3);
  55.         }
  56.     }
  57. }
Add Comment
Please, Sign In to add comment