Advertisement
gmansano

Atividade 5 - Exercício 2 [Televisao.cs]

Nov 29th, 2020
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 KB | None | 0 0
  1. using System;
  2. using System.Runtime.InteropServices.ComTypes;
  3.  
  4. namespace Atividade5Ex2
  5. {
  6.     public class Televisao
  7.     {
  8.         string canalnom = "Globo";
  9.         private int canalnum = 3;
  10.         private int volume = 50;
  11.  
  12.         public int volumep
  13.         {
  14.             get
  15.             {
  16.                 return volume;
  17.             }
  18.             set
  19.             {
  20.                 if (value < 0)
  21.                 {
  22.                     volume = 0;
  23.                 }
  24.                 else if (value > 100)
  25.                 {
  26.                     volume = 100;
  27.                 }
  28.                 else
  29.                 {
  30.                     volume = value;
  31.                 }
  32.             }
  33.         }
  34.         public int canalp
  35.         {
  36.             get
  37.             {
  38.                 return canalnum;
  39.             }
  40.             set
  41.             {
  42.                 if (value < 0)
  43.                 {
  44.                     canalnum = 0;
  45.                 }
  46.                 else
  47.                 {
  48.                     canalnum = value;
  49.                 }
  50.             }
  51.         }
  52.         ~Televisao()
  53.         {
  54.  
  55.         }
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement