ProgaOra/20231129/ConsoleApp1/Program.cs

51 lines
1.3 KiB
C#
Raw Normal View History

2023-12-13 10:35:33 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
public class Alak
{
public virtual void Rajzol() {
Console.WriteLine("Alakzat rajzolása.");
}
}
public class Kor : Alak
{
public override void Rajzol()
{
Console.WriteLine("Kör rajzolása.");
}
}
public class Kocka : Alak
{
public override void Rajzol()
{
Console.WriteLine("Téglalap rajzolása.");
Console.WriteLine(" .+------+ +------+ ");
Console.WriteLine(" .' | .' | /| /| ");
Console.WriteLine("+---+--+' | +-+----+ | ");
Console.WriteLine("| | | | | | | | ");
Console.WriteLine("| ,+--+---+ | +----+-+ ");
Console.WriteLine("|.' | .' |/ |/ ");
Console.WriteLine("+------+' +------+ ");
}
}
class Program
{
static void Main(string[] args)
{
Alak haromszog = new Alak();
haromszog.Rajzol();
Kocka teglalap = new Kocka();
teglalap.Rajzol();
Console.ReadLine();
}
}
}