class Program
{
static void Main()
{
Console.WriteLine("5x^2 - 5x +82 = ");
Console.WriteLine("Input your x");
int x = Convert.ToInt32(Console.ReadLine());
int sum = (5 * x * x) – (5 * x) + 82;
Console.WriteLine(sum);
}
}
class Program
{
static void Main()
{
Console.WriteLine("Input your length :"); int l =
Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Input your width : "); int w =
Convert.ToInt32(Console.ReadLine());
int parameter = (l + w) * 2;
int area = l * w;
Console.WriteLine("Parameter : {0} Area : {1}", parameter, area);
}
}
class Program
{
static void Main()
{
Console.WriteLine("Input radius r = "); double r =
Convert.ToDouble(Console.ReadLine());
double area = r * r * 3.14;
double parameter = 2 * r * 3.14;
Console.WriteLine("Area of the circle = {0} Parameter of the circle = {1}",
area, parameter);
}
}
class Program
{
static void Main()
{
Console.WriteLine("Input your hour and minute "); int hour =
Convert.ToInt32(Console.ReadLine()); int minute = Convert.ToInt32(Console.ReadLine());
int second = hour * 60 * 60 + minute * 60;
Console.WriteLine("Total seconds : " + second);
}
}x`
class Program
{
static void Main()
{
Console.WriteLine("Input the number of month you have worked : ");int month =
Convert.ToInt32(Console.ReadLine());
double coef = 1;
if (month < 12) { coef = 1.92; }
else
{
if (month >= 12 & month < 36) { coef = 2.25; }
else
{
if (month >= 36 & month < 48) { coef = 3.54; }
else { if (month >= 48) { coef = 5; } }
}
}
double Salary = coef * 50;
Console.WriteLine("Payroll : {0}$", Salary);
}
}
static void Main()
{
Console.WriteLine("Input the amount of km you go on a taxi : "); double km1 =
Convert.ToDouble(Console.ReadLine());
double fare = 0;
double km2 = km1;
double km3 = 1;
if (km1 <= 1) { fare = 10; }
else { if (km1 > 1 & km1 <= 30) { km2 = km2 - 1; km3 = km2 / 0.2; fare = 10 +
Math.Floor(km3) * 2; }
else
{
if (km1 > 30) { km2 = km2 - 30; ; fare = 300 + Math.Floor(km2) * 6; }
}
}
Console.WriteLine("Payment : {0}", fare);
}
static void Main()
{
Console.WriteLine("Input a, b, c");
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
int c = Convert.ToInt32(Console.ReadLine());
double x1, x2;
double d = b * b - 4 * a * c;
if (a == 0) { x1 = (-c) / b; Console.WriteLine("x = {0}", x1); }
else
{
if (d < 0) { Console.WriteLine("Invalid"); }
else
{
if (d == 0) { x1 = x2 = (-b) / (2 * a); Console.WriteLine("x1 = x2 =
{0}", x1); }
else { if (d > 0) { x1 = (-b - Math.Sqrt(d)) / (2 * a); x2 = (-b +
Math.Sqrt(d)) / (2 * a); Console.WriteLine("x1 = {0} x2 = {1}", x1, x2); } }
}
}
}