Advertisement
gmansano

Atividade 6 - Exercício 1 [Program.cs]

Sep 26th, 2020
2,028
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 24.55 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Atividade6Ex1
  4. {
  5.     abstract public class Veiculo
  6.     {
  7.         protected int velocidade_max;
  8.         protected int velocidade_atual;
  9.         protected bool ligado;
  10.         protected string tipo_energia;
  11.         protected string combustível;
  12.         protected int potencia;
  13.  
  14.         public Veiculo()
  15.         {
  16.             ligado = true;
  17.         }
  18.     }
  19.  
  20.     abstract public class Veiculo_Terrestre : Veiculo
  21.     {
  22.         protected int qnt_rodas;
  23.         protected int qnt_portas;
  24.  
  25.         abstract public void Potencia(int potencia);
  26.         abstract public void Qnt_Rodas(int qnt_rodas);
  27.         abstract public void Qnt_Portas(int qnt_portas);
  28.         abstract public void Tipo_Energia(string tipo_energia);
  29.         abstract public void Combustivel(string combustivel);
  30.         abstract public void Velocidade_Max(int velocidade_max);
  31.         abstract public void Velocidade_Atual(int velocidade_atual);
  32.     }
  33.     abstract public class Veiculo_Aereo : Veiculo
  34.     {
  35.         protected int qnt_rodas;
  36.         protected int qnt_portas;
  37.         protected int altura_max;
  38.  
  39.         abstract public void Potencia(int potencia);
  40.         abstract public void Qnt_Rodas(int qnt_rodas);
  41.         abstract public void Qnt_Portas(int qnt_portas);
  42.         abstract public void Altura_Max(int altura_max);
  43.         abstract public void Tipo_Energia(string tipo_energia);
  44.         abstract public void Combustivel(string combustivel);
  45.         abstract public void Velocidade_Max(int velocidade_max);
  46.         abstract public void Velocidade_Atual(int velocidade_atual);
  47.     }
  48.     abstract public class Veiculo_Aquatico : Veiculo
  49.     {
  50.         protected int peso_max;
  51.         protected int profundidade_max;
  52.         protected string tipo_agua;
  53.  
  54.         abstract public void Potencia(int potencia);
  55.         abstract public void Tipo_Energia(string tipo_energia);
  56.         abstract public void Combustivel(string combustivel);
  57.         abstract public void Peso_Max(int peso_max);
  58.         abstract public void Profundidade_Max(int profundidade_max);
  59.         abstract public void Tipo_Agua(string tipo_agua);
  60.         abstract public void Velocidade_Max(int velocidade_max);
  61.         abstract public void Velocidade_Atual(int velocidade_atual);
  62.  
  63.     }
  64.     abstract public class Veiculo_Animal : Veiculo
  65.     {
  66.         protected bool vivo;
  67.         protected int peso_max;
  68.         protected int qnt_patas;
  69.         protected string especie;
  70.         protected string alimentacao;
  71.  
  72.         abstract public void Vivo(bool vivo);
  73.         abstract public void Qnt_Patas(int qnt_patas);
  74.         abstract public void Especie(string especie);
  75.         abstract public void Alimentacao(string alimentacao);
  76.         abstract public void Potencia(int potencia);
  77.         abstract public void Tipo_Energia(string tipo_energia);
  78.         abstract public void Combustivel(string combustivel);
  79.         abstract public void Peso_Max(int peso_max);
  80.         abstract public void Velocidade_Max(int velocidade_max);
  81.         abstract public void Velocidade_Atual(int velocidade_atual);
  82.  
  83.     }
  84.     abstract public class Veiculo_Anfibio : Veiculo
  85.     {
  86.         protected int qnt_rodas;
  87.         protected int qnt_portas;
  88.         protected int peso_max;
  89.         protected int profundidade_max;
  90.         protected string tipo_agua;
  91.  
  92.  
  93.         abstract public void Peso_Max(int peso_max);
  94.         abstract public void Profundidade_Max(int profundidade_max);
  95.         abstract public void Tipo_Agua(string tipo_agua);
  96.         abstract public void Potencia(int potencia);
  97.         abstract public void Qnt_Rodas(int qnt_rodas);
  98.         abstract public void Qnt_Portas(int qnt_portas);
  99.         abstract public void Tipo_Energia(string tipo_energia);
  100.         abstract public void Combustivel(string combustivel);
  101.         abstract public void Velocidade_Max(int velocidade_max);
  102.         abstract public void Velocidade_Atual(int velocidade_atual);
  103.     }
  104.  
  105.     public class Carro : Veiculo_Terrestre
  106.     {
  107.         private string nome;
  108.         private string marca;
  109.  
  110.         public string nome_p
  111.         {
  112.             get {return nome;}
  113.             set
  114.             {
  115.                 if (value.Length > 3 && value.Length < 12)
  116.                 {
  117.                     nome = value;
  118.                 }
  119.             }
  120.         } //get set nome.
  121.         public string marca_p
  122.         {
  123.             get { return marca; }
  124.             set
  125.             {
  126.                 if (value.Length > 3 && value.Length < 12)
  127.                 {
  128.                     marca = value;
  129.                 }
  130.             }
  131.         } //get set marca.
  132.  
  133.         override public void Qnt_Rodas(int qnt_rodas)
  134.         {
  135.             this.qnt_rodas = qnt_rodas;
  136.         }
  137.         override public void Qnt_Portas(int qnt_portas)
  138.         {
  139.             this.qnt_portas = qnt_portas;
  140.         }
  141.         override public void Tipo_Energia(string tipo_energia)
  142.         {
  143.             this.tipo_energia = tipo_energia;
  144.         }
  145.         override public void Combustivel(string combustivel)
  146.         {
  147.             this.combustível = combustivel;
  148.         }
  149.         override public void Potencia(int potencia)
  150.         {
  151.             this.potencia = potencia;
  152.         }
  153.         override public void Velocidade_Max(int velocidade_max)
  154.         {
  155.             if (velocidade_max > 0)
  156.             {
  157.                 this.velocidade_max = velocidade_max;
  158.             }
  159.             else
  160.             {
  161.                 this.velocidade_max = 0;
  162.             }
  163.         }
  164.         override public void Velocidade_Atual(int velocidade_atual)
  165.         {
  166.             if (velocidade_atual > 0)
  167.             {
  168.                 this.velocidade_atual = velocidade_atual;
  169.             }
  170.             else
  171.             {
  172.                 this.velocidade_atual = 0;
  173.             }
  174.         }
  175.     }
  176.     public class Moto : Veiculo_Terrestre
  177.     {
  178.         private string nome;
  179.         private string marca;
  180.  
  181.         public string nome_p
  182.         {
  183.             get { return nome; }
  184.             set
  185.             {
  186.                 if (value.Length > 3 && value.Length < 12)
  187.                 {
  188.                     nome = value;
  189.                 }
  190.             }
  191.         } //get set nome.
  192.         public string marca_p
  193.         {
  194.             get { return marca; }
  195.             set
  196.             {
  197.                 if (value.Length > 3 && value.Length < 12)
  198.                 {
  199.                     marca = value;
  200.                 }
  201.             }
  202.         } //get set marca.
  203.  
  204.         override public void Qnt_Rodas(int qnt_rodas)
  205.         {
  206.             this.qnt_rodas = qnt_rodas;
  207.         }
  208.         override public void Qnt_Portas(int qnt_portas)
  209.         {
  210.             this.qnt_portas = qnt_portas;
  211.         }
  212.         override public void Tipo_Energia(string tipo_energia)
  213.         {
  214.             this.tipo_energia = tipo_energia;
  215.         }
  216.         override public void Combustivel(string combustivel)
  217.         {
  218.             this.combustível = combustivel;
  219.         }
  220.         override public void Potencia(int potencia)
  221.         {
  222.             this.potencia = potencia;
  223.         }
  224.         override public void Velocidade_Max(int velocidade_max)
  225.         {
  226.             if (velocidade_max > 0)
  227.             {
  228.                 this.velocidade_max = velocidade_max;
  229.             }
  230.             else
  231.             {
  232.                 this.velocidade_max = 0;
  233.             }
  234.         }
  235.         override public void Velocidade_Atual(int velocidade_atual)
  236.         {
  237.             if (velocidade_atual > 0)
  238.             {
  239.                 this.velocidade_atual = velocidade_atual;
  240.             }
  241.             else
  242.             {
  243.                 this.velocidade_atual = 0;
  244.             }
  245.         }
  246.     }
  247.     public class Bicicleta : Veiculo_Terrestre
  248.     {
  249.         private string nome;
  250.         private string marca;
  251.  
  252.         public string nome_p
  253.         {
  254.             get { return nome; }
  255.             set
  256.             {
  257.                 if (value.Length > 3 && value.Length < 12)
  258.                 {
  259.                     nome = value;
  260.                 }
  261.             }
  262.         } //get set nome.
  263.         public string marca_p
  264.         {
  265.             get { return marca; }
  266.             set
  267.             {
  268.                 if (value.Length > 3 && value.Length < 12)
  269.                 {
  270.                     marca = value;
  271.                 }
  272.             }
  273.         } //get set marca.
  274.  
  275.         override public void Qnt_Rodas(int qnt_rodas)
  276.         {
  277.             this.qnt_rodas = qnt_rodas;
  278.         }
  279.         override public void Qnt_Portas(int qnt_portas)
  280.         {
  281.             this.qnt_portas = qnt_portas;
  282.         }
  283.         override public void Tipo_Energia(string tipo_energia)
  284.         {
  285.             this.tipo_energia = tipo_energia;
  286.         }
  287.         override public void Combustivel(string combustivel)
  288.         {
  289.             this.combustível = combustivel;
  290.         }
  291.         override public void Potencia(int potencia)
  292.         {
  293.             this.potencia = potencia;
  294.         }
  295.         override public void Velocidade_Max(int velocidade_max)
  296.         {
  297.             if (velocidade_max > 0)
  298.             {
  299.                 this.velocidade_max = velocidade_max;
  300.             }
  301.             else
  302.             {
  303.                 this.velocidade_max = 0;
  304.             }
  305.         }
  306.         override public void Velocidade_Atual(int velocidade_atual)
  307.         {
  308.             if (velocidade_atual > 0)
  309.             {
  310.                 this.velocidade_atual = velocidade_atual;
  311.             }
  312.             else
  313.             {
  314.                 this.velocidade_atual = 0;
  315.             }
  316.         }
  317.     }
  318.     public class Caminhao : Veiculo_Terrestre
  319.     {
  320.         private string nome;
  321.         private string marca;
  322.  
  323.         public string nome_p
  324.         {
  325.             get { return nome; }
  326.             set
  327.             {
  328.                 if (value.Length > 3 && value.Length < 12)
  329.                 {
  330.                     nome = value;
  331.                 }
  332.             }
  333.         } //get set nome.
  334.         public string marca_p
  335.         {
  336.             get { return marca; }
  337.             set
  338.             {
  339.                 if (value.Length > 3 && value.Length < 12)
  340.                 {
  341.                     marca = value;
  342.                 }
  343.             }
  344.         } //get set marca.
  345.  
  346.         override public void Qnt_Rodas(int qnt_rodas)
  347.         {
  348.             this.qnt_rodas = qnt_rodas;
  349.         }
  350.         override public void Qnt_Portas(int qnt_portas)
  351.         {
  352.             this.qnt_portas = qnt_portas;
  353.         }
  354.         override public void Tipo_Energia(string tipo_energia)
  355.         {
  356.             this.tipo_energia = tipo_energia;
  357.         }
  358.         override public void Combustivel(string combustivel)
  359.         {
  360.             this.combustível = combustivel;
  361.         }
  362.         override public void Potencia(int potencia)
  363.         {
  364.             this.potencia = potencia;
  365.         }
  366.         override public void Velocidade_Max(int velocidade_max)
  367.         {
  368.             if (velocidade_max > 0)
  369.             {
  370.                 this.velocidade_max = velocidade_max;
  371.             }
  372.             else
  373.             {
  374.                 this.velocidade_max = 0;
  375.             }
  376.         }
  377.         override public void Velocidade_Atual(int velocidade_atual)
  378.         {
  379.             if (velocidade_atual > 0)
  380.             {
  381.                 this.velocidade_atual = velocidade_atual;
  382.             }
  383.             else
  384.             {
  385.                 this.velocidade_atual = 0;
  386.             }
  387.         }
  388.     }
  389.     public class Navio : Veiculo_Aquatico
  390.     {
  391.         private string nome;
  392.         private string marca;
  393.  
  394.         public string nome_p
  395.         {
  396.             get { return nome; }
  397.             set
  398.             {
  399.                 if (value.Length > 3 && value.Length < 12)
  400.                 {
  401.                     nome = value;
  402.                 }
  403.             }
  404.         } //get set nome.
  405.         public string marca_p
  406.         {
  407.             get { return marca; }
  408.             set
  409.             {
  410.                 if (value.Length > 3 && value.Length < 12)
  411.                 {
  412.                     marca = value;
  413.                 }
  414.             }
  415.         } //get set marca.
  416.  
  417.         override public void Potencia(int potencia)
  418.         {
  419.             this.potencia = potencia;
  420.         }
  421.         override public void Tipo_Energia(string tipo_energia)
  422.         {
  423.             this.tipo_energia = tipo_energia;
  424.         }
  425.         override public void Combustivel(string combustivel)
  426.         {
  427.             this.combustível = combustivel;
  428.         }
  429.         override public void Peso_Max(int peso_max)
  430.         {
  431.             this.peso_max = peso_max;
  432.         }
  433.         override public void Profundidade_Max(int profundidade_max)
  434.         {
  435.             this.profundidade_max = profundidade_max;
  436.         }
  437.         override public void Tipo_Agua(string tipo_agua)
  438.         {
  439.             this.tipo_agua = tipo_agua;
  440.         }
  441.         override public void Velocidade_Max(int velocidade_max)
  442.         {
  443.             if (velocidade_max > 0)
  444.             {
  445.                 this.velocidade_max = velocidade_max;
  446.             }
  447.             else
  448.             {
  449.                 this.velocidade_max = 0;
  450.             }
  451.         }
  452.         override public void Velocidade_Atual(int velocidade_atual)
  453.         {
  454.             if (velocidade_atual > 0)
  455.             {
  456.                 this.velocidade_atual = velocidade_atual;
  457.             }
  458.             else
  459.             {
  460.                 this.velocidade_atual = 0;
  461.             }
  462.         }
  463.     }
  464.     public class Submarino : Veiculo_Aquatico
  465.     {
  466.         private string nome;
  467.         private string marca;
  468.  
  469.         public string nome_p
  470.         {
  471.             get { return nome; }
  472.             set
  473.             {
  474.                 if (value.Length > 3 && value.Length < 12)
  475.                 {
  476.                     nome = value;
  477.                 }
  478.             }
  479.         } //get set nome.
  480.         public string marca_p
  481.         {
  482.             get { return marca; }
  483.             set
  484.             {
  485.                 if (value.Length > 3 && value.Length < 12)
  486.                 {
  487.                     marca = value;
  488.                 }
  489.             }
  490.         } //get set marca.
  491.  
  492.         override public void Potencia(int potencia)
  493.         {
  494.             this.potencia = potencia;
  495.         }
  496.         override public void Tipo_Energia(string tipo_energia)
  497.         {
  498.             this.tipo_energia = tipo_energia;
  499.         }
  500.         override public void Combustivel(string combustivel)
  501.         {
  502.             this.combustível = combustivel;
  503.         }
  504.         override public void Peso_Max(int peso_max)
  505.         {
  506.             this.peso_max = peso_max;
  507.         }
  508.         override public void Profundidade_Max(int profundidade_max)
  509.         {
  510.             this.profundidade_max = profundidade_max;
  511.         }
  512.         override public void Tipo_Agua(string tipo_agua)
  513.         {
  514.             this.tipo_agua = tipo_agua;
  515.         }
  516.         override public void Velocidade_Max(int velocidade_max)
  517.         {
  518.             if (velocidade_max > 0)
  519.             {
  520.                 this.velocidade_max = velocidade_max;
  521.             }
  522.             else
  523.             {
  524.                 this.velocidade_max = 0;
  525.             }
  526.         }
  527.         override public void Velocidade_Atual(int velocidade_atual)
  528.         {
  529.             if (velocidade_atual > 0)
  530.             {
  531.                 this.velocidade_atual = velocidade_atual;
  532.             }
  533.             else
  534.             {
  535.                 this.velocidade_atual = 0;
  536.             }
  537.         }
  538.     }
  539.     public class Cavalo : Veiculo_Animal
  540.     {
  541.         private string nome;
  542.  
  543.         public string nome_p
  544.         {
  545.             get { return nome; }
  546.             set
  547.             {
  548.                 if (value.Length > 3 && value.Length < 12)
  549.                 {
  550.                     nome = value;
  551.                 }
  552.             }
  553.         } //get set nome.
  554.        
  555.         override public void Vivo(bool vivo)
  556.         {
  557.             this.vivo = vivo;
  558.         }
  559.         override public void Qnt_Patas(int qnt_patas)
  560.         {
  561.             this.qnt_patas = qnt_patas;
  562.         }
  563.         override public void Especie(string especie)
  564.         {
  565.             this.especie = especie;
  566.         }
  567.         override public void Alimentacao(string alimentacao)
  568.         {
  569.             this.alimentacao = alimentacao;
  570.         }
  571.         override public void Potencia(int potencia)
  572.         {
  573.             this.potencia = potencia;
  574.         }
  575.         override public void Tipo_Energia(string tipo_energia)
  576.         {
  577.             this.tipo_energia = tipo_energia;
  578.         }
  579.         override public void Combustivel(string combustivel)
  580.         {
  581.             this.combustível = combustivel;
  582.         }
  583.         override public void Peso_Max(int peso_max)
  584.         {
  585.             this.peso_max = peso_max;
  586.         }
  587.         override public void Velocidade_Max(int velocidade_max)
  588.         {
  589.             if (velocidade_max > 0)
  590.             {
  591.                 this.velocidade_max = velocidade_max;
  592.             }
  593.             else
  594.             {
  595.                 this.velocidade_max = 0;
  596.             }
  597.         }
  598.         override public void Velocidade_Atual(int velocidade_atual)
  599.         {
  600.             if (velocidade_atual > 0)
  601.             {
  602.                 this.velocidade_atual = velocidade_atual;
  603.             }
  604.             else
  605.             {
  606.                 this.velocidade_atual = 0;
  607.             }
  608.         }
  609.     }
  610.     public class Aviao : Veiculo_Aereo
  611.     {
  612.         private string nome;
  613.         private string marca;
  614.  
  615.         public string nome_p
  616.         {
  617.             get { return nome; }
  618.             set
  619.             {
  620.                 if (value.Length > 3 && value.Length < 12)
  621.                 {
  622.                     nome = value;
  623.                 }
  624.             }
  625.         } //get set nome.
  626.         public string marca_p
  627.         {
  628.             get { return marca; }
  629.             set
  630.             {
  631.                 if (value.Length > 3 && value.Length < 12)
  632.                 {
  633.                     marca = value;
  634.                 }
  635.             }
  636.         } //get set marca.
  637.  
  638.         override public void Potencia(int potencia)
  639.         {
  640.             this.potencia = potencia;
  641.         }
  642.         override public void Qnt_Rodas(int qnt_rodas)
  643.         {
  644.             this.qnt_rodas = qnt_rodas;
  645.         }
  646.         override public void Qnt_Portas(int qnt_portas)
  647.         {
  648.             this.qnt_portas = qnt_portas;
  649.         }
  650.         override public void Altura_Max(int altura_max)
  651.         {
  652.             this.altura_max = altura_max;
  653.         }
  654.         override public void Tipo_Energia(string tipo_energia)
  655.         {
  656.             this.tipo_energia = tipo_energia;
  657.         }
  658.         override public void Combustivel(string combustivel)
  659.         {
  660.             this.combustível = combustivel;
  661.         }
  662.         override public void Velocidade_Max(int velocidade_max)
  663.         {
  664.             if (velocidade_max > 0)
  665.             {
  666.                 this.velocidade_max = velocidade_max;
  667.             }
  668.             else
  669.             {
  670.                 this.velocidade_max = 0;
  671.             }
  672.         }
  673.         override public void Velocidade_Atual(int velocidade_atual)
  674.         {
  675.             if (velocidade_atual > 0)
  676.             {
  677.                 this.velocidade_atual = velocidade_atual;
  678.             }
  679.             else
  680.             {
  681.                 this.velocidade_atual = 0;
  682.             }
  683.         }
  684.     }
  685.     public class Helicoptero : Veiculo_Aereo
  686.     {
  687.         private string nome;
  688.         private string marca;
  689.  
  690.         public string nome_p
  691.         {
  692.             get { return nome; }
  693.             set
  694.             {
  695.                 if (value.Length > 3 && value.Length < 12)
  696.                 {
  697.                     nome = value;
  698.                 }
  699.             }
  700.         } //get set nome.
  701.         public string marca_p
  702.         {
  703.             get { return marca; }
  704.             set
  705.             {
  706.                 if (value.Length > 3 && value.Length < 12)
  707.                 {
  708.                     marca = value;
  709.                 }
  710.             }
  711.         } //get set marca.
  712.  
  713.         override public void Potencia(int potencia)
  714.         {
  715.             this.potencia = potencia;
  716.         }
  717.         override public void Qnt_Rodas(int qnt_rodas)
  718.         {
  719.             this.qnt_rodas = qnt_rodas;
  720.         }
  721.         override public void Qnt_Portas(int qnt_portas)
  722.         {
  723.             this.qnt_portas = qnt_portas;
  724.         }
  725.         override public void Altura_Max(int altura_max)
  726.         {
  727.             this.altura_max = altura_max;
  728.         }
  729.         override public void Tipo_Energia(string tipo_energia)
  730.         {
  731.             this.tipo_energia = tipo_energia;
  732.         }
  733.         override public void Combustivel(string combustivel)
  734.         {
  735.             this.combustível = combustivel;
  736.         }
  737.         override public void Velocidade_Max(int velocidade_max)
  738.         {
  739.             if (velocidade_max > 0)
  740.             {
  741.                 this.velocidade_max = velocidade_max;
  742.             }
  743.             else
  744.             {
  745.                 this.velocidade_max = 0;
  746.             }
  747.         }
  748.         override public void Velocidade_Atual(int velocidade_atual)
  749.         {
  750.             if (velocidade_atual > 0)
  751.             {
  752.                 this.velocidade_atual = velocidade_atual;
  753.             }
  754.             else
  755.             {
  756.                 this.velocidade_atual = 0;
  757.             }
  758.         }
  759.     }
  760.     public class Anfibio : Veiculo_Anfibio
  761.     {
  762.         private string nome;
  763.         private string marca;
  764.  
  765.         public string nome_p
  766.         {
  767.             get { return nome; }
  768.             set
  769.             {
  770.                 if (value.Length > 3 && value.Length < 12)
  771.                 {
  772.                     nome = value;
  773.                 }
  774.             }
  775.         } //get set nome.
  776.         public string marca_p
  777.         {
  778.             get { return marca; }
  779.             set
  780.             {
  781.                 if (value.Length > 3 && value.Length < 12)
  782.                 {
  783.                     marca = value;
  784.                 }
  785.             }
  786.         } //get set marca.
  787.  
  788.         override public void Peso_Max(int peso_max)
  789.         {
  790.             this.peso_max = peso_max;
  791.         }
  792.         override public void Profundidade_Max(int profundidade_max)
  793.         {
  794.             this.profundidade_max = profundidade_max;
  795.         }
  796.         override public void Tipo_Agua(string tipo_agua)
  797.         {
  798.             this.tipo_agua = tipo_agua;
  799.         }
  800.         override public void Qnt_Rodas(int qnt_rodas)
  801.         {
  802.             this.qnt_rodas = qnt_rodas;
  803.         }
  804.         override public void Qnt_Portas(int qnt_portas)
  805.         {
  806.             this.qnt_portas = qnt_portas;
  807.         }
  808.         override public void Tipo_Energia(string tipo_energia)
  809.         {
  810.             this.tipo_energia = tipo_energia;
  811.         }
  812.         override public void Combustivel(string combustivel)
  813.         {
  814.             this.combustível = combustivel;
  815.         }
  816.         override public void Potencia(int potencia)
  817.         {
  818.             this.potencia = potencia;
  819.         }
  820.         override public void Velocidade_Max(int velocidade_max)
  821.         {
  822.             if (velocidade_max > 0)
  823.             {
  824.                 this.velocidade_max = velocidade_max;
  825.             }
  826.             else
  827.             {
  828.                 this.velocidade_max = 0;
  829.             }
  830.         }
  831.         override public void Velocidade_Atual(int velocidade_atual)
  832.         {
  833.             if (velocidade_atual > 0)
  834.             {
  835.                 this.velocidade_atual = velocidade_atual;
  836.             }
  837.             else
  838.             {
  839.                 this.velocidade_atual = 0;
  840.             }
  841.         }
  842.     }
  843.  
  844.     class Program
  845.     {
  846.         static void Main(string[] args)
  847.         {
  848.             Carro carro1 = new Carro();
  849.             carro1.marca_p = "Volkswagen";
  850.             carro1.nome_p = "Gol GTI 2.0";
  851.             carro1.Qnt_Portas(2);
  852.             carro1.Qnt_Rodas(4);
  853.             carro1.Tipo_Energia("Combustão Interna");
  854.             carro1.Combustivel("Gasolina");
  855.             carro1.Potencia(120);
  856.             carro1.Velocidade_Max(180);
  857.             carro1.Velocidade_Atual(0);
  858.  
  859.             Cavalo cavalo1 = new Cavalo();
  860.             cavalo1.nome_p = "Mustang";
  861.             cavalo1.Vivo(true);
  862.             cavalo1.Alimentacao("Herbívoro");
  863.             cavalo1.Combustivel("Comida");
  864.             cavalo1.Tipo_Energia("Mecânica");
  865.             cavalo1.Especie("Equino");
  866.             cavalo1.Qnt_Patas(4);
  867.             cavalo1.Peso_Max(100);
  868.             cavalo1.Potencia(1);
  869.             cavalo1.Velocidade_Max(70);
  870.             cavalo1.Velocidade_Atual(0);
  871.         }  
  872.     }
  873. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement