-
-
Save laacz/7b1f836143ab8bcced24af707f5b6076 to your computer and use it in GitHub Desktop.
Klucis FTW
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApp1 | |
{ | |
class Persona | |
{ | |
public string vards; | |
public int vecums; | |
public string dzimums; | |
public Persona(String vards, int vecums, Boolean vai_meitene) | |
{ | |
this.vards = vards; | |
this.vecums = vecums; | |
if (vai_meitene) | |
{ | |
this.dzimums = "meitene"; | |
} | |
else | |
{ | |
this.dzimums = "puika"; | |
} | |
} | |
public String apraksts() | |
{ | |
String result = this.dzimums + ", vārdā " + this.vards + " "; | |
return result; | |
} | |
public static void tests1() | |
{ | |
Console.WriteLine("statiska metode"); | |
} | |
public void tests2() | |
{ | |
Console.WriteLine("nestatiska metode"); | |
} | |
public void liek(Klucis klucis) | |
{ | |
Console.WriteLine(this.apraksts() + " liek " + klucis.krasa_akuzativs + " kluci, kura " + klucis.apraksts()); | |
} | |
} | |
class Klucis | |
{ | |
public string krasa; | |
public string krasa_akuzativs; | |
public int izmers; | |
public string apraksts() | |
{ | |
return "izmērs ir " + this.izmers + " un krāsa ir " + this.krasa; | |
} | |
public Klucis(string krasa, int izmers, string krasa_akuzativs) | |
{ | |
this.krasa = krasa; | |
this.krasa_akuzativs = krasa_akuzativs; | |
this.izmers = izmers; | |
} | |
} | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Klucis viens = new Klucis("sarkans", 99, "sarkanu"); | |
Console.WriteLine(viens.apraksts()); | |
Persona amanda = new Persona("Amanda", 12, true); | |
Console.WriteLine(amanda.apraksts()); | |
amanda.liek(viens); | |
Console.ReadLine(); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment