INPUT:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication20
{
class myclass
{
public double
visquare(double vi)
{
double s = vi *vi;
return s;
}
public double
vfsquare(double vf)
{
double s = vf * vf;
return s;
}
public double s(double vf,double vi)
{
double s = (vfsquare(vf) + visquare(vi)) / (2 *
9.98);
return s;
}
static void Main(string[] args)
{
double vf,vi;
Console.WriteLine("plz
enter the final velocity");
vf=Convert.ToDouble(Console.ReadLine());
Console.WriteLine("plz
enter the initial velocity ");
vi= Convert.ToDouble(Console.ReadLine());
myclass m = new myclass();
Console.WriteLine("vf
= (vi2+vf2)/2a = {0}",m.s(vf,vi));
}
}
}
No comments:
Post a Comment