solved fordulo_2 feladat_1

This commit is contained in:
Digi
2025-03-05 14:41:25 +01:00
parent dc971298b8
commit d07b86a0a1
42 changed files with 510 additions and 3 deletions

View File

@@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Program
{
class Idopont
{
public int Ora { get; set; }
public int Perc { get; set; }
public string Name { get; set; }
public Double Angle { get; set; }
public Idopont(int ora, int perc)
{
Ora = ora;
Perc = perc;
Name = ReturnFormattedTime();
if (Ora >= 12)
{
Ora -= 12;
}
}
public string ReturnFormattedTime()
{
return string.Format("{0}:{1}", Ora, Perc);
}
public double ClockAngle()
{
double angle = 0;
angle = Math.Abs(Ora * 30 + Perc * 0.5 - Perc * 6);
if (angle > 180)
{
angle = 360 - angle;
}
Angle = angle;
return angle;
}
}
}