26 lines
609 B
C#
26 lines
609 B
C#
namespace ObiektowaTeoria
|
|
{
|
|
/**
|
|
* Definicja klasy Samochod
|
|
* Zobacz w pliku Program.cs:8 jak używać tej klasy
|
|
*/
|
|
|
|
public class Samochod() {
|
|
// Pola klasy
|
|
public string Marka = "";
|
|
public int RokProdukcji;
|
|
public bool StanSilnika = false;
|
|
|
|
// Metoda klasy
|
|
public void UruchomSilnik() {
|
|
if (!StanSilnika) {
|
|
StanSilnika = true;
|
|
Console.WriteLine("Silnik uruchomiony.");
|
|
} else {
|
|
Console.WriteLine("Silnik jest już uruchomiony.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|