Created
April 18, 2018 06:23
-
-
Save pmikstacki/dedaafec2aa226cab2fe0a225330d731 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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