using System;
/*Write a call Bedroom
Write property TvBrand
Write a readonly Property LightBrand
Write a void method AssignBrand with 1 string parameter. The value of the parameter string is passed to the field lightBrand inside the method
Write a write only Property NoOfLights
Write a method LightDetails that returns NoOfLights
In MainMethod,
Assign the value to TvBrand
Print the value of TvBrand
Call method AssignBrand ;
Print property LightBrand
Assign value to NoOfLights property
Call method LightDetails and print the returned result*/
public class bedroom
{
private string tvbrand;
public string TvBrand
get
return tvbrand;
}
set
tvbrand = value;
private string lightBrand;
public string LightBrand
return lightBrand;
public void AssignBrand(string a)
lightBrand = a;
private int nooflights;
public int NoOfLights
nooflights = value;
public int lightdetails()
return nooflights ;
public class Program
public static void Main()
bedroom ob = new bedroom();
ob.TvBrand = "LG";
Console.WriteLine(ob.TvBrand);
ob.AssignBrand("acer");
Console.WriteLine(ob.LightBrand);
ob.NoOfLights = 10;
int result = ob.lightdetails();