diff --git a/Lesson1/Lesson1/151196.cs b/Lesson1/Lesson1/151196.cs new file mode 100644 index 0000000..da872dc --- /dev/null +++ b/Lesson1/Lesson1/151196.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp4 +{ + class Program + { + static void Main(string[] args) + { + int[] tablica = { 1,2,3,4,5,6,7,8,9,10 }; + { + Console.WriteLine(string.Join(",", tablica)); + } + for(int i= 0; i l3) + Console.WriteLine("Istnieje trojkat"); + else + Console.WriteLine("Nie istnieje"); + + + Console.WriteLine("Podaj liczbe "); + int cyfra, wynik = 0; + cyfra = int.Parse(Console.ReadLine()); + if(cyfra < 15 && cyfra >5) + while (cyfra != 0) + { + cyfra-=1; + wynik += cyfra; + } + + + + + + Console.WriteLine("Podaj liczbe "); + int liczba; + liczba = int.Parse(Console.ReadLine()); + if ((liczba > 4 && liczba < 7) && (liczba != 10)) + Console.WriteLine("Koniec"); + else + while ((liczba < 4 && liczba > 7) && (liczba == 10)) + { + Console.WriteLine("Podaj liczbe ponownie"); + } + } + } +} + + + + + + + +/* Console.ReadLine(); +bool stop = false; +while (stop!= true) + { + Console.WriteLine(Nie podałeś imienia); + stop = true; + } +*/ diff --git a/Lesson2/Lesson2/151196.cs b/Lesson2/Lesson2/151196.cs new file mode 100644 index 0000000..f11e45e --- /dev/null +++ b/Lesson2/Lesson2/151196.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp5 +{ + class Program + { + static void Main(string[] args) + { + Console.Write("Podaj liczbe:"); + double liczba; + liczba = double.Parse(Console.ReadLine()); + Console.Write(liczba); + liczba *= 1.609344; + Console.Write(liczba); + } + } +} diff --git a/Lesson2/Lesson2/Car.cs b/Lesson2/Lesson2/Car.cs new file mode 100644 index 0000000..03be856 --- /dev/null +++ b/Lesson2/Lesson2/Car.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp5 +{ + class Car + { + private string marka; + private int rokProdukcji; + private int przebieg; + private string model; + private int iloscDrzwi; + private int pojemnoscSilnika; + public double srednieSpalanie; + + public int jedz(int trasa) + { + this.przebieg += trasa; + return this.przebieg; + } + + private double ObliczSpalanie(double dlugoscTrasy) + { + this.srednieSpalanie *= dlugoscTrasy; + return this.srednieSpalanie; + } + public void showCar() + { + Console.WriteLine("Marka" + marka); + Console.WriteLine("rokProdukcji" + rokProdukcji); + Console.WriteLine("przebieg" + przebieg); + Console.WriteLine("model" + model); + Console.WriteLine("iloscDrzwi" + iloscDrzwi); + Console.WriteLine("pojemnoscSilnika" + pojemnoscSilnika); + Console.WriteLine("srednieSpalanie" + srednieSpalanie); + + } + } +} + diff --git a/Lesson2/Lesson2/ProgramCar.cs b/Lesson2/Lesson2/ProgramCar.cs new file mode 100644 index 0000000..2f35a61 --- /dev/null +++ b/Lesson2/Lesson2/ProgramCar.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp5 +{ + class Program + { + static void Main(string[] args) + { + /* + Car car1 = new Car(); + car1.marka = "Mercedes"; + car1.rokProdukcji = 2018; + car1.showCar(); + + Car car2 = new Car(); + car2.marka = "Audi"; + car2.rokProdukcji = 2020; + car2.przebieg = 10; + car2.model = "RS3"; + car2.iloscDrzwi = 5; + car2.pojemnoscSilnika = 600; + car2.srednieSpalanie = 12; + */ + Console.ReadKey(); + } + } +} diff --git a/Lesson4/IMapa.cs b/Lesson4/IMapa.cs new file mode 100644 index 0000000..58725e4 --- /dev/null +++ b/Lesson4/IMapa.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Zaliczenie +{ + interface IMapa + { + public void generate(); + public void list(); + public void show(); + } +} diff --git a/Lesson4/Mapa.cs b/Lesson4/Mapa.cs new file mode 100644 index 0000000..a5e61d9 --- /dev/null +++ b/Lesson4/Mapa.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Zaliczenie +{ + class Mapa:, IMapa + { + public int ShowMap(int wielkosc) + { + int[]rozmiar = new int[wielkosc]; + } + } + + class Point + { + public int x; + public int y; + + public void print() + { + Console.WriteLine("X" + x); + Console.WriteLine("Y" + y); + } + } + + class MapElement:Point + { + public char icon; + public void print() + { + Console.WriteLine("Icon" + icon); + } + } + + class Grass:MapElement + { + public int trawa; + MapElement G = new MapElement(); + public void print() + { + Console.WriteLine("Współrzędne" + (trawa + x + y)); + } + } + + class Tree:MapElement + { + public int drzewo; + MapElement T = new MapElement(); + public void print() + { + Console.WriteLine("Współrzędne" + (drzewo + x + y)); + } + + } + + class Rock:MapElement + { + public int kamień; + MapElement R = new MapElement(); + public void print() + { + Console.WriteLine("Współrzędne" + (kamień + x + y)); + } + } +} diff --git a/Lesson6/klasy.cs b/Lesson6/klasy.cs new file mode 100644 index 0000000..366d0f2 --- /dev/null +++ b/Lesson6/klasy.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ConsoleApp3 +{ + class Osoba + { + public string Imie; + public string Nazwisko; + + virtual public void WypiszInfo() + { + Console.WriteLine("Imie" + Imie); + Console.WriteLine("Nazwisko" + Nazwisko); + } + + } + + class Student:Osoba + { + public int rokStudiów; + public int numerGrupy; + public int numerAlbumu; + + public Student(int rokStudiów, int numerGrupy, int numerAlbumu) + { + this.rokStudiów = rokStudiów; + this.numerGrupy = numerGrupy; + this.numerAlbumu = numerAlbumu; + } + + override public void WypiszInfo() + { + Console.WriteLine("rokStudiów" + rokStudiów); + Console.WriteLine("numerGrupy" + numerGrupy); + Console.WriteLine("numerAlbumu" + numerAlbumu); + } + + + } + + class Figura + { + protected int a; + protected int b; + protected int c; + + + public int ObliczPole() + { + return this.a * this.b * this.c; + } + + public void Lista() + { + var list = new List(); + var list1 = new List(); + + foreach(int a in ) + { + Console.WriteLine(ObliczPole(a)); + } + } + } + + class Kwadrat:Figura + { + private int ObliczPole(int a) + { + return this.a * this.a; + } + } + + class Trójkąt:Figura + { + private int ObliczPole(int a, int b) + { + return (this.a * this.b) / 2; + } + } +} diff --git a/Lesson7/Biblioteka_Interfejs b/Lesson7/Biblioteka_Interfejs new file mode 100644 index 0000000..8bbb339 --- /dev/null +++ b/Lesson7/Biblioteka_Interfejs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ConsoleApp1 +{ + interface IZarzadzanieKatalogiem + { + string WyszukajPoTytule() + { + + } + + int WyszukajPole() + { + + } + + void WypiszWszystko() + { + + } + } +} diff --git a/Lesson7/Biblioteka_Osoba b/Lesson7/Biblioteka_Osoba new file mode 100644 index 0000000..a7190f1 --- /dev/null +++ b/Lesson7/Biblioteka_Osoba @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ConsoleApp1 +{ + class Osoba + { + protected string Imie; + protected string Nazwisko; + + public Osoba(string imie, string nazwisko) + { + Imie = imie; + Nazwisko = nazwisko; + } + } + + class Autor : Osoba + { + private string narodowosc; + + public Autor(string imie, string nazwisko) : base(imie, nazwisko) + { + } + } + + abstract class Pozycja + { + protected string tytuł; + protected int id; + protected string wydawnictwo; + protected int rokWydania; + + + abstract void WypiszInfo() + { + Console.Write("tytuł" + tytuł); + Console.Write("id" + id); + Console.Write("wydawnictwo" + wydawnictwo); + Console.Write("rokWydania" + rokWydania); + } + } + + class Książka : Pozycja + { + private int liczbaStron; + + public Książka(int liczbaStron) + { + this.liczbaStron = liczbaStron; + } + + public void WypiszInfo() + { + Console.Write("liczbaStron" + liczbaStron); + } + } + + class Czasopismo : Pozycja + { + private int numer; + + public void WypiszInfo() + { + Console.Write("numer" + numer); + } + } + + class Katalog : IZarzadzanieKatalogiem + { + private string dzialTematyczny; + List listaPozycji; + + public Katalog(string dzialTematyczny, List listaPozycji) + { + this.dzialTematyczny = dzialTematyczny; + this.listaPozycji = listaPozycji; + } + + public void DodajPozycje() + { + List.Add((Książka) || (Czasopismo)); + } + + public string WyszukajPoTytule() + { + string tytuł; + if (tytuł = string.Parse(Console.ReadLine())); + this.tytuł = tytuł; + } + + public int WyszukajPole() + { + int pole; + if (pole = int.Parse(Console.ReadLine())) ; + this.id = pole; + } + + public void WypiszWszystko() + { + Console.Write("Tytul:" + WyszukajPoTytule()); + Console.Write("Pole:" + WyszukajPole()); + } + + } +} diff --git a/Lesson7/Biblioteka_Program b/Lesson7/Biblioteka_Program new file mode 100644 index 0000000..5fb3525 --- /dev/null +++ b/Lesson7/Biblioteka_Program @@ -0,0 +1,35 @@ +using System; + +namespace ConsoleApp1 +{ + class Program + { + static void Main(string[] args) + { + int numerIndeksu; + numerIndeksu = int.Parse(Console.ReadLine()); + int zestaw = (numerIndeksu % 3) + 1; + Console.Write(zestaw); + + Osoba osoba1 = new Osoba(); + Autor autor1 = new Autor(); + Pozycja pozycja1 = new Pozycja(); + Książka książka1 = new Książka(); + Czasopismo czasopismo1 = new Czasopismo(); + Katalog katalog1 = new Katalog(); + + pozycja1.WypiszInfo(); + książka1.WypiszInfo(); + książka1.liczbaStron = 200; + książka1.Książka(); + czasopismo1.WypiszInfo(); + katalog1.DodajPozycje(); + katalog1.WyszukajPoTytule(); + katalog1.WyszukajPole(); + katalog1.WypiszWszystko(); + + Console.ReadKey(); + Console.WriteLine("Hello World!"); + } + } +} diff --git a/Snake.rar b/Snake.rar new file mode 100644 index 0000000..a0cd076 Binary files /dev/null and b/Snake.rar differ