clearing code

This commit is contained in:
2023-07-01 16:59:32 +02:00
parent 71fb61f6dc
commit 85acd235f3
5 changed files with 21 additions and 68 deletions

View File

@@ -1,17 +1,7 @@
namespace TicketSystem.Tickets
{
public class Adult: Ticket
public class Adult
{
public int price { get; }
public Adult()
{
price = 20;
}
public int PriceWithReduction()
{
return price - price/100*20;
}
}
}

View File

@@ -1,6 +1,6 @@
namespace TicketSystem.Tickets
{
public class Child: Ticket
public class Child
{
public int price { get; }
@@ -8,10 +8,5 @@
{
price = 5;
}
public int PriceWithReduction()
{
return 2;
}
}
}

View File

@@ -1,17 +1,7 @@
namespace TicketSystem.Tickets
{
public class Student: Ticket
public class Student
{
public int price { get; }
public Student()
{
price = 10;
}
public int PriceWithReduction()
{
return 10-3;
}
}
}

View File

@@ -7,9 +7,13 @@
Adult
}
public interface Ticket
public class Ticket
{
int price { get; }
int PriceWithReduction();
private int price { get; }
public Ticket()
{
price = 20;
}
}
}