Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace hexagon
- {
- class hatszog
- {
- double a;
- public hatszog (double a)
- {
- this.a = a;
- }
- public double A
- {
- get { return a; }
- set { a = value; }
- }
- public double Hterulet(double a)
- {
- return ((3 * Math.Sqrt(3) * (a* a)) / 2);
- }
- public double Hkerulet(double a)
- {
- return (6 * a);
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Ird be az A értékét: ");
- double a = double.Parse(Console.ReadLine());
- hatszog h1 = new hatszog(a);
- Console.WriteLine("A hatszög területe: {0}", h1.Hterulet(a));
- Console.WriteLine("A hatszög kerülete: {0}", h1.Hkerulet(a));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement