Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » Homework HelpRSS Feeds

Program to calculate the frequency for different values of C starting from 0.01 to 0.1 in steps of 0.01

Posted By: Easy Tutor     Category: Java     Views: 3828

For a Certain electrical circuit with an inductance L and resistance R, the damped natural frequency is given by
Frequency=sqrt((1/L*C)-((R*R)-(4*C*C)))
It is desired to study the variation of this frequency with C(capacitance). Write a
program to calculate the frequency for different values of C starting from 0.01 to
0.1 in steps of 0.01.

Code for Program to calculate the frequency for different values of C starting from 0.01 to 0.1 in steps of 0.01 in Java

import java.io.*;
import java.lang.Math;

class frequency 
{
    publicstaticvoid main(String args[]) 
    {
       int i;
       float L,R,frequency,C;
       String str;
       try{
       BufferedReader obj = new BufferedReader(new InputStreamReader(System.in));
       System.out.print("Enter value of Inductance(L) :  ");
       System.out.flush();
       str=obj.readLine();
       L=Float.parseFloat(str);
       System.out.print("Enter value of Resistance(R) :  ");
       System.out.flush();
       str=obj.readLine();
       R=Float.parseFloat(str);   
       System.out.println("     C              Frequency");
       System.out.println("==========         ===========");
       for(C=0.01f,i=1;i<=10;i++,C=C+0.01f)
       {
            frequency=(float)(Math.sqrt((1/L*C)-((R*R)-(4*C*C))));
             System.out.println("      "+C+"              "+frequency);
        }
      }
      catch(Exception e) {}
    }
}
  
Share: 



Easy Tutor
Easy Tutor author of Program to calculate the frequency for different values of C starting from 0.01 to 0.1 in steps of 0.01 is from United States. Easy Tutor says

Hello Friends,

I am Free Lance Tutor, who helped student in completing their homework.

I have 4 Years of hands on experience on helping student in completing their homework. I also guide them in doing their final year projects.

I have share many programs on this website for everyone to use freely, if you need further assistance, than please contact me on easytutor.2ya [at the rate] gmail [dot] com

I have special discount scheme for providing tutor services. I am providing tutor service to students from various contries, currently most of my students are from United States, India, Australia, Pakistan, Germany, UK and Canada.

I am also here to expand my technical network to receive more opportunity in my career, make friends to help them in resolving their technical problem, learn and share my knowledge, If you like to be my friend, Please send me friend request.

Thanks,
Happy Programming :)

 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!