Computer Science, asked by Bledvision, 3 months ago

Write a following program in Java: The time period of a Simple Pendulum is given by the formula: T = 2π√(l/g) Write a program to calculate the time period of a Simple Pendulum by taking length and acceleration due to gravity (g) as inputs. Prepare variable table for the same.

Answers

Answered by devigeeta13873
0

Answer:

Write a program in java to calculate the time period of a Simple ... by taking length and acceleration due to gravity (g ) as inputs. 1 ... double t=2*(22.0/7.0)*(Math. sqrt(l/g);.

Answered by kitkat333
1

import java.util.Scanner;

public class KboatSimplePendulum

{

   public static void main(String args[]) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter length: ");

       double l = in.nextDouble();

       System.out.print("Enter g: ");

       double g = in.nextDouble();

       double t = 2 * (22.0 / 7.0) * Math.sqrt(l/g);

       System.out.println("T = " + t);

   }

}

Similar questions