Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(Statics) An annulus is a cylindrical rod with a hollow center. It\'s second mom

ID: 665477 • Letter: #

Question

(Statics) An annulus is a cylindrical rod with a hollow center. It's second moment of inertia is given by:

a.) Using this formula write a function called annulusMoment( ) that accecpts two double precision number as parameters (one for the outter radius and one for the inner radius), calculates the corresponding second moment of inertia , and displays the result.

b.) Include the following written in Exercise 5a in a working program. Make sure your function is called from main( ). Test the function by passing various data to it.

Explanation / Answer

a) public void annulusMoment(double r1,double r2){
       I=pi*(Math.pow(r2,4)-Math.pow(r1,4))/4;
       System.out.println("Second moment of inertia I: "+I);
   }

b) public class Moment {
  
   private double I;
   private final double pi=3.14159;
  
   public void annulusMoment(double r1,double r2){
       I=pi*(Math.pow(r2,4)-Math.pow(r1,4))/4;
       System.out.println("Second moment of inertia I: "+I);
   }

   public static void main(String[] args) {
       Moment m=new Moment();
       m.annulusMoment(3.4, 1.2);
       m.annulusMoment(4.3, 2.1);
       m.annulusMoment(6.6, 5.5);
   }

}