Skip to content

Instantly share code, notes, and snippets.

@pmikstacki
Created April 18, 2018 06:23
Show Gist options
  • Save pmikstacki/dedaafec2aa226cab2fe0a225330d731 to your computer and use it in GitHub Desktop.
Save pmikstacki/dedaafec2aa226cab2fe0a225330d731 to your computer and use it in GitHub Desktop.
// Program
using System;
namespace hhh
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Witaj!");
Console.WriteLine("Podaj marke");
string marka = Console.ReadLine();
Console.WriteLine("Podaj kolor");
string kolor = Console.ReadLine();
//while(true){
//try{
//double dlugosc = double.Parse(Console.ReadLine());
//break;
//}catch{Console.WriteLine("jesteś debilem");}
//}
Samochod s = new Samochod(marka, kolor); //Tworzymy nowy samochód z opisu (klasy)
Console.WriteLine(string.Format("Samochód marki {0} o kolorze {1}", s.Marka, s.Kolor));
Console.ReadKey();
}
}
}
//Samochód
using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace hhh
{
public class Samochod
{
private string marka;
private string kolor;
public string Marka
{
get { return marka; }
set { marka = value; }
}
public string Kolor
{
get { return kolor; }
set { kolor = value; }
}
public Samochod(string marka, string kolor)
{
Marka = marka;
Kolor = kolor;
}
public void Pisz()
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment