gmansano

Atividade 2 - Exercício 3 [Pessoa.cs]

Aug 26th, 2020
2,172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.24 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exercicio3
  4. {
  5.     public class Pessoa
  6.     {
  7.         private string nome;
  8.         private string data_nascimento;
  9.         private float altura;
  10.         private float peso;
  11.  
  12.         public string nome_p
  13.         {
  14.             get
  15.             {
  16.                 return nome;
  17.             }
  18.             set
  19.             {
  20.                 nome = value;
  21.             }
  22.         }
  23.         public string data_nascimento_p
  24.         {
  25.             get
  26.             {
  27.                 return data_nascimento;
  28.             }
  29.             set
  30.             {
  31.                 data_nascimento = value;
  32.             }
  33.         }
  34.         public float altura_p
  35.         {
  36.             get
  37.             {
  38.                 return altura;
  39.             }
  40.             set
  41.             {
  42.                 altura = value;
  43.             }
  44.         }
  45.         public float peso_p
  46.         {
  47.             get
  48.             {
  49.                 return peso;
  50.             }
  51.             set
  52.             {
  53.                 peso = value;
  54.             }
  55.         }
  56.  
  57.         public double IMC()
  58.         {
  59.             double imc = Math.Round(peso / (altura * altura), 2);
  60.             return imc;
  61.         }
  62.         ~Pessoa()
  63.         {
  64.  
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment