Last active
August 29, 2015 14:01
-
-
Save valdiney/5e5f2268f7d982db436d to your computer and use it in GitHub Desktop.
Class Retângulo:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Created by SharpDevelop. | |
* User: ruan | |
* Date: 10/05/2014 | |
* Time: 11:15 | |
* | |
* To change this template use Tools | Options | Coding | Edit Standard Headers. | |
*/ | |
using System; | |
namespace caixa | |
{ | |
class Retangulo | |
{ | |
public double _base; | |
public double _altura; | |
public Retangulo(double _base, double _altura) | |
{ | |
this._base = _base; | |
this._altura = _altura; | |
} | |
public double area() | |
{ | |
double calculo = this._base * this._altura; | |
return calculo; | |
} | |
public double perimetro() | |
{ | |
double calculo = (this._base * 2) + (this._altura * 2); | |
return calculo; | |
} | |
} | |
class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
var retangulo = new Retangulo(15,10); | |
Console.WriteLine("Area do Retangulo é " + retangulo.area()); | |
Console.WriteLine("Perimetro do Retangulo é " + retangulo.perimetro()); | |
Console.Write("Press any key to continue . . . "); | |
Console.ReadKey(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment