/******************************************************************************
Online C# Compiler.
Code, Compile, Run and Debug C# program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
using System;
class HelloWorld {
static void Main() {
Console.WriteLine("Hello World");
//1
TV TV1 = new TV();
TV1.type = "LG";
TV1.size = 44;
TV1.year = 2022;
//2
TV TV2 = new TV();
TV2.type = "Samsung";
TV2.size = 65;
TV2.year = 2008;
//3
TV TV3 = new TV();
TV3.type = "Toshiba";
TV3.size = 55;
TV3.year = 2017;
TV2.PrintDetails();
TV1.PrintDetails();
TV1.year = 2000;
TV1.PrintDetails();
TV1.AddSize(6);
TV1.PrintDetails();
TV TV4 = new TV();
TV4.PrintDetails();
TV4.AddSize(10);
}
}
using System;
public class TV
{
//صفات
public string type;
public int size;
public int year;
//عمليات
public void PrintDetails()
{
Console.WriteLine("type: {0}", this.type);
Console.WriteLine("size: {0}", this.size);
Console.WriteLine("year: {0}", this.year);
Console.WriteLine("---------------------");
Console.WriteLine();
}
public void AddSize(int x)
{
this.size += x;
}
}