Computer Science, asked by mamtasrivastavashta1, 1 month ago

solve this program fast ...​

Attachments:

Answers

Answered by neetasingh1106
3

Explanation:

// The program is written in Java

class distance

{

public double distanc( double t, double u, double a)

{

double d = u * t + 1/2.0f * a * t * t;

return d;

}

}

Answered by Oreki
2

\textbf{\large Question}

  \textsf{Design a class n\symbol{97}med \texttt{Distance} to get d by using the formula, \:$d = ut + \dfrac{1}{2}at^{2}$}\\\textsf{and implementing it into a method with suitable parameters.}

\textbf{\large Answer}

  \texttt{public class Distance \{}\\\texttt{\hspace{1.5em} double distanc(double acc, double time, double u) \{}\\\texttt{\hspace{3em} return u * t + 0.5 * a * t * t;}\\\texttt{\hspace{1.5em} \}}\\\texttt{\}}

Similar questions