using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication33
{
interface acaratv
{
void berita();
void olahraga();
void movie();
void hiburan();
}
class antv : acaratv
{
public void berita()
{
Console.WriteLine("siaran berita antv");
}
public void olahraga()
{
Console.WriteLine("siaran lensa olah raga");
}
public void movie()
{
Console.WriteLine("siaran movie antv");
}
public void hiburan()
{
Console.WriteLine("siaran hiburan antv");
}
}
class trans7 : acaratv
{
public void berita()
{
Console.WriteLine("siaran berita trans7");
}
public void olahraga()
{
Console.WriteLine("siaran olah raga tran7");
}
public void movie()
{
Console.WriteLine("siaran boiskop trans7");
}
public void hiburan()
{
Console.WriteLine("siaran hiburan trans7");
}
}
class rcti : acaratv
{
public void berita()
{
Console.WriteLine("siaran berita rcti");
}
public void olahraga()
{
Console.WriteLine("siaran lensa olah rcti");
}
public void movie()
{
Console.WriteLine("siaran movie rcti");
}
public void hiburan()
{
Console.WriteLine("siaran hiburan rcti");
}
}
class sctv : acaratv
{
public void berita()
{
Console.WriteLine("siaran berita sctv");
}
public void olahraga()
{
Console.WriteLine("siaran olah raga sctv");
}
public void movie()
{
Console.WriteLine("siaran movie sctv");
}
public void hiburan()
{
Console.WriteLine("siaran hiburan sctv");
}
}
class Program
{
static void Main(string[] args)
{
acaratv tv;
Console.WriteLine("Program Acara TV");
Console.WriteLine("pilih saluran = ");
Console.WriteLine(" 1. ANTV");
Console.WriteLine(" 2. Trans7");
Console.WriteLine(" 3. RCTI");
Console.WriteLine(" 4. SCTV");
Console.Write(" Pilih ");
int a = int.Parse(Console.ReadLine());
if (a == 1)
{
tv = new antv();
tv.berita();
tv.olahraga();
tv.movie();
tv.hiburan();
}
else
if (a == 2)
{
tv = new trans7();
tv.berita();
tv.olahraga();
tv.movie();
tv.hiburan();
}
else
if (a == 3)
{
tv = new rcti();
tv.berita();
tv.olahraga();
tv.movie();
tv.hiburan();
}
else
if (a == 4)
{
tv = new sctv();
tv.berita();
tv.olahraga();
tv.movie();
tv.hiburan();
}
else
Console.WriteLine("tidak ada saluran");
}
}
}
No comments:
Post a Comment