Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace lab3
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             Lista_studentow lista_ = new Lista_studentow();
  11.  
  12.             List<Student> list = new List<Student>();
  13.  
  14.             lista_.DodajStudenta(list);
  15.         }
  16.     }
  17.  
  18.     class Student
  19.     {
  20.         private string _imie;
  21.         private string _nazwisko;
  22.         private string _pesel;
  23.         private string _dataUrodzenia;
  24.         private string _grupy;
  25.  
  26.         public Student(string imie, string nazwisko, string pesel, string dataUrodzenia, string grupy)
  27.         {
  28.             _imie = imie;
  29.             _nazwisko = nazwisko;
  30.             _pesel = pesel;
  31.             _dataUrodzenia = dataUrodzenia;
  32.             _grupy = grupy;
  33.         }
  34.  
  35.         public string toString()
  36.         {
  37.             return "tak";
  38.         }
  39.     }
  40.  
  41.     class Lista_studentow
  42.     {
  43.         public void DodajStudenta(List<Student> listaStudentow)
  44.         {
  45.             listaStudentow.Add(new Student(Console.ReadLine(), Console.ReadLine(), Console.ReadLine(), Console.ReadLine(),Console.ReadLine()));
  46.         }
  47.  
  48.         public void UsunStudenta(List<Student> listaStudentow)
  49.         {
  50.             int index = 0; // tu podaj index
  51.             listaStudentow.RemoveAt(index);
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement