Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace zad3
- {
- class Student
- {
- string nazwisko;
- string imie;
- int numerAlbumu;
- int semestr;
- public Student(string nazwisko, string imie, int numerAlbumu)
- {
- this.nazwisko = nazwisko;
- this.imie = imie;
- this.numerAlbumu = numerAlbumu;
- semestr =1;
- }
- public void Wyświetl()
- {
- if ( semestr < 8)
- {
- Console.WriteLine(" Student {0}, {1}, semestr: {2}, numer albumu {3}",imie, nazwisko, numerAlbumu, semestr);
- }
- else
- {
- Console.WriteLine("Absolwent: {0}, {1}", imie, nazwisko);
- }
- }
- public void Promocja()
- {
- if (semestr < 8)
- {
- semestr++;
- }
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Student s1 = new Student( "Kowalski","Jan", 654 );
- s1.Wyświetl();
- s1.Promocja();
- s1.Wyświetl();
- s1.Promocja();
- s1.Wyświetl();
- s1.Promocja();
- s1.Wyświetl();
- s1.Promocja();
- s1.Wyświetl();
- s1.Promocja();
- s1.Wyświetl();
- s1.Promocja();
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement