using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ushtrime_25_tetor
{
internal class Class1(int n)
{
private int n = n;
private int sum = 0;
public void printNumbers(int start = 1)
{
for(int i = start; i <= n; i++)
{
Console.WriteLine(i);
sum += i;
}
}
public void checkAge(int age)
{
if(age >= 18)
{
Console.WriteLine("You can vote");
} else
{
Console.WriteLine("You cannot vote");
}
}
public void printSumFrom(int end,int start = 1)
{
int s = 0;
if(end > 0)
{
for(int i = start; i <= end; i++)
{
s += i;
}
Console.WriteLine("SUM from {0} to {1} = {2}", start,end,s);
}
}
public void compareWith(int b)
{
if(n > b)
{
Console.WriteLine("{0} > {1}", n, b);
} else if(b > n)
{
Console.WriteLine("{0} > {1}", b, n);
} else
{
Console.WriteLine("{0} = {1}", b, n);
}
}
public void checkPositivity()
{
if (n == 0)
{
Console.WriteLine("It is just 0", n);
}
else if (n > 0)
{
Console.WriteLine("{0} is positive", n);
} else
{
Console.WriteLine("{0} is negative", n);
}
}
public Boolean checkIfEven(int number)
{
return number%2 == 0;
}
public void printUntilZero()
{
int input = int.Parse(Console.ReadLine());
while(input != 0)
{
if (checkIfEven(input))
{
Console.WriteLine("Number even found!");
break;
} else
{
Console.WriteLine("Not an even number! Continue entering:");
input = int.Parse(Console.ReadLine());
}
}
}
public void printPowSumFrom(int end, double pow = 3)
{
int s = 0;
String a= "";
for (double i = 2; i <= end; i+=2)
{
s += (int)Math.Pow(i, pow);
a += i.ToString() + "^" + pow;
if(i < end)
{
a += " + ";
}
}
Console.WriteLine(a + " = " + s);
}
}
}