Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace Hw5
- {
- class Program
- {
- static void Main(string[] args)
- {
- TvOnOrOff tvSet = new TvOnOrOff();
- bool tvOn = tvSet.turnOn();
- if (tvOn)
- {
- ChoiceTvProgram program = new ChoiceTvProgram();
- string choiceProg = program.TvProg();
- Console.WriteLine("We choice chanel {0}", choiceProg);
- }
- Console.ReadLine();
- }
- }
- class TvOnOrOff
- {
- public bool turnOn()
- {
- Console.WriteLine("Turn on Tv 1) On 2) Off");
- int turnOn = int.Parse(Console.ReadLine());
- if (turnOn == 1)
- {
- return true;
- }
- else
- return false;
- }
- }
- class ChoiceTvProgram
- {
- public string TvProg()
- {
- int resaultChanel = inputChanel();
- switch (resaultChanel)
- {
- case 1: return "Inter";
- case 2: return "1+1";
- case 3: return "STB";
- case 4: return "Noviy";
- case 5: return "ICTV";
- case 6: return "Ukraina";
- case 7: return "2+2";
- case 8: return "Simon";
- case 9: return "OTB";
- case 10: return "K1";
- default: return "Incorrect enter program ";
- }
- }
- private int inputChanel()
- {
- Console.WriteLine("Input number chanel to 1 from 10: ");
- int inputProgram = int.Parse(Console.ReadLine());
- return inputProgram;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement