Help, learning this program! How do I Fade IN/OUT??

I have a guitar rhythem on a track that is looped multiple times in a row.
When I open it in the Editor to Fade out, it Fades out every individual loop. I just want the end of the entire loop sequence Faded out.
How do I fade in or out?

Beside the track name (eg. "Track 1"), on the left side there is a small triangle, if you click it, you will be given a "Volume" and "and Pan" editor, double clicking on the black line will create points, you can adjust these points to adjust you volume, the the volume between the two points will gradually change.
Make a point where you want your fade out to start, then a point where you want the fade to end, by dragging the end point down with the mouse or, the volume slider you will achieve the fade out effect you are looking for.
Does this help?

Similar Messages

  • I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in

    I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?

    For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
    For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
    See: 
    http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html  
    Be well...

  • I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio

    I purchased Adobe Acrobat x Pro recently and installed it, I have compatibility issues vision 2013. The adobe pdf converter  plug in stays inactive despite all my efforts to activate it, I need help with this? How can i get the plug in to work with Visio 2013?

    For MS Visio (any version) only the appropriate version of Acrobat *PRO* provides PDFMaker for Visio.
    For Visio 2013 specifically you must have Acrobat XI Pro (updated to at least 11.0.1).
    See: 
    http://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html  
    Be well...

  • Please help on this program

    Dear Friends,
    With the help of this program I am trying to connect two instruments (One is CM110 monochromator of Spectral products and another one is from Keithley 2400 source meter) with the same programs. With the help of this program I am trying to increase the wavelength of the monochromator by say 10 nm and want to read the current at applied source meter voltage. 
    But the problem is each execution of while loop it is keeping ON/OFF the souce meter applied voltage . I want to keep the applied source meter voltage on through out the whole while loop and read the current, but I am not able to do so.
    Please help me. For your further information I am attaching the LabVIEW Program.
    Thanks in anticipation
    Regards
    Upendra Pandey
    Attachments:
    p2_for_1.vi ‏25 KB

    Chemical,
    You may want to try initializing and closing the Keithley outside of the main loop.  Regards, -SS 

  • When someone send me a message I don't want them to no I read it I click allow this to happen when I first updated my phone but I do not want this feature how can I take it out ?

    When someone send me a message I don't want them to no I read it I click allow this to happen when I first updated my phone but I do not want this feature how can I take it out ?

    If you mean iMessage then go into Messages in the Settings app. The feature is Read Receipts.

  • New to Java and need help with this program..please!

    I'd really appreciate any helpful comments about this program assignment that I have to turn in a week from Friday. I'm taking a class one night a week and completely new to Java. I'd ask my professor for help, but we can't call him during the week and he never answers e-mails. He didn't tell us how to call from other classes yet, and I just can't get the darn thing to do what I want it to do!
    The assignment requirements are:
    1. Change a card game application that draws two cards
    and the higher card wins, to a Blackjack application
    2. Include a new class called Hand
    3. The Hand class should record the number of draws
    4. The application should prompt for a number of draws
    5. The game is played against the Dealer
    6. The dealer always draws a card if the dealer's hand total is <= 17
    7. Prompt the player after each hand if he wants to quit
    8. Display the total games won by the dealer and total and the total games wond by the player after each hand
    9. Display all of the dealer's and player's cards at the
    end of each hand
    10. Player has the option of drawing an additional card after the first two cards
    11. The Ace can have a value of 11 or 1
    (Even though it's not called for in the requirements, I would like to be able to let the Ace have a value of 1 or an 11)
    The following is my code with some comments about a few things that are driving me nuts:
    import java.util.*;
    import javax.swing.*;
    import java.text.*;
    public class CardDeck
    public CardDeck()
    deck = new Card[52];
    fill();
    shuffle();
    public void fill()
    int i;
    int j;
    for (i = 1; i <= 13; i++)
    for (j = 1; j <= 4; j++)
    deck[4 * (i - 1) + j - 1] = new Card(i, j);
    cards = 52;
    public void shuffle()
    int next;
    for (next = 0; next < cards - 1; next++)
    int rand = (int)(Math.random()*(next+1));
    Card temp = deck[next];
    deck[next] = deck[rand];
    deck[rand] = temp;
    public final Card draw()
    if (cards == 0)
    return null;
    cards--;
    return deck[cards];
    public int changeValue()
    int val = 0;
    boolean ace = false;
    int cds;
    for (int i = 0; i < cards; i++)
    if (cardValue > 10)
    cardValue = 10;
    if (cardValue ==1)     {
    ace = true;
    val = val + cardValue;
    if ( ace = true && val + 10 <= 21 )
    val = val + 10;
    return val;
    public static void main(String[] args)
    CardDeck d = new CardDeck();
    int x = 3;
    int i;
    int wins = 1;
    int playerTotal = 1;
    do {
    Card dealer = (d.draw());
    /**I've tried everything I can think of to call the ChangeValue() method after I draw the card, but nothing is working for me.**/
    System.out.println("Dealer draws: " + dealer);
    do {
    dealer = (d.draw());
    System.out.println(" " + dealer);
    }while (dealer.rank() <= 17);
    Card mine = d.draw();
    System.out.println("\t\t\t\t Player draws: "
    + mine);
    mine = d.draw();
    System.out.println("\t\t\t\t\t\t" + mine);
    do{
    String input = JOptionPane.showInputDialog
    ("Would you like a card? ");
    if(input.equalsIgnoreCase("yes"))
         mine = d.draw();
    System.out.println("\t\t\t\t\t\t" + mine);
         playerTotal++;
         else if(input.equalsIgnoreCase("no"))
    System.out.println("\t\t\t\t Player stands");
         else
    System.out.println("\t\tInvalid input.
    Please try again.");
    I don't know how to go about making and calling a method or class that will combine the total cards delt to the player and the total cards delt to the dealer. The rank() method only seems to give me the last cards drawn to compare with when I try to do the tests.**/
    if ((dealer.rank() > mine.rank())
    && (dealer.rank() <= 21)
    || (mine.rank() > 21)
    && (dealer.rank() < 22)
    || ((dealer.rank() == 21)
    && (mine.rank() == 21))
    || ((mine.rank() > 21)
    && (dealer.rank() <= 21)))
    System.out.println("Dealer wins");
    wins++;
         else
    System.out.println("I win!");
    break;
    } while (playerTotal <= 1);
    String stop = JOptionPane.showInputDialog
    ("Would you like to play again? ");
    if (stop.equalsIgnoreCase("no"))
    break;
    if (rounds == 5)
    System.out.println("Player wins " +
    (CardDeck.rounds - wins) + "rounds");
    } while (rounds <= 5);
    private Card[] deck;
    private int cards;
    public static int rounds = 1;
    public int cardValue;
    /**When I try to compile this nested class, I get an error message saying I need a brace here and at the end of the program. I don't know if any of this code would work because I've tried adding braces and still can't compile it.**/
    class Hand()
    static int r = 1;
    public Hand() { CardDeck.rounds = r; }
    public int getRounds() { return r++; }
    final class Card
    public static final int ACE = 1;
    public static final int JACK = 11;
    public static final int QUEEN = 12;
    public static final int KING = 13;
    public static final int CLUBS = 1;
    public static final int DIAMONDS = 2;
    public static final int HEARTS = 3;
    public static final int SPADES = 4;
    public Card(int v, int s)
    value = v;
    suit = s;
    public int getValue() { return value; }
    public int getSuit() { return suit;  }
    public int rank()
    if (value == 1)
    return 4 * 13 + suit;
    else
    return 4 * (value - 1) + suit;
    /**This works, but I'm confused. How is this method called? Does it call itself?**/
    public String toString()
    String v;
    String s;
    if (value == ACE)
    v = "Ace";
    else if (value == JACK)
    v = "Jack";
    else if (value == QUEEN)
    v = "Queen";
    else if (value == KING)
    v = "King";
    else
    v = String.valueOf(value);
    if (suit == DIAMONDS)
    s = "Diamonds";
    else if (suit == HEARTS)
    s = "Hearts";
    else if (suit == SPADES)
    s = "Spades";
    else
    s = "Clubs";
    return v + " of " + s;
    private int value; //Value is an integer, so how can a
    private int suit; //string be assigned to an integer?
    }

    Thank you so much for offering to help me with this Jamie! When I tried to call change value using:
    Card dealer = (d.changeValue());
    I get an error message saying:
    Incompatible types found: int
    required: Card
    I had my weekly class last night and the professor cleared up a few things for me, but I've not had time to make all of the necessary changes. I did find out how toString worked, so that's one question out of the way, and he gave us a lot of information for adding another class to generate random numbers.
    Again, thank you so much. I really want to learn this but I'm feeling so stupid right now. Any help you can give me about the above error message would be appreciated.

  • I need help on this program..

    import java.util.*;
    public class D3
    private static int[] z = new int[100000];
    private static int first=z[0];
    private static int last=z[n-1];
    private static int n=100000;
    public static void main(String args[])
    Scanner input=new Scanner(System.in);
    for(int i=0;i<z.length;i++)
    z=2*i;
    int seqSearch(z;50000;n); //method call 4 key where key=mid
    int binSearch(z;first;last;50000);
    int seqSearch(z;35467;n); //method call 4 key where key in the left half
    int binSearch(z;first;last;35467);
    int seqSearch(z;89703;n); //method call 4 key where key in the right half
    int binSearch(z;first;last;89703);
    public int seqSearch(int z[];int key;int n)
    long start = System.currentTimeMillis();
    int count=0;
    int ans=-1;
    for(int i=0;i<n;i++)
    if z=key
    count++
    {ans=i
    break;}
    return ans;
    long elapsed = System.currentTimeMillis() - start;
    System.out.print("Execution Time:" + elapsed);
    System.out.print("# of Basic Operations:" + count);
    public int binSearch(int z[];int first;int last;int key)
    long start = System.currentTimeMillis();
    int count=0;
    if(last><first){
    count++;
    index=-1;
    else
    count++;
    int mid=(first+last)/2
    if(ket=z[mid]{
    index=mid;
    else
    if(key><z[mid]){
    index = binSearch(z[];first;mid-1;key);
    else
    index=binSearch(z[];mid+1;last;key);
    return index;
    long elapsed = System.currentTimeMillis() - start;
    System.out.print("Execution Time:" + elapsed);
    System.out.print("# of Basic Operations:" + count);
    if anyone could please tell me whats wrong with my code i'd be greatful...the program is supposed to perform binary and sequential search on a sorted array of 100000 numbers.once on an item in the middle of the array once on the right side of it and once on the left side...i also need to count the number of basic operations for the same number in both sequential and binary to see whats better.and i need to check the time...i think the method call is wrong,not sure though...plz i need help.its not compiling and i dont know why..

    Just add new messages to a thread you've already created. Don't create a new thread each time.
    Anyway, look. This is wrong:int seqSearch(z;50000;n); //method call 4 key where key=midfor two reasons. The first is that leading "int"; it doesn't mean anything here. "int" is used to declare an integer variable, but you're not declaring a variable here, you're invoking a method. The second problem is that you're using semicolons to separate arguments in the method call, but actually commas are correct. You probably want something more like this:
    int result;
    result = seqSearch(z, 50000, n);  //method call 4 key where key=mid.
    Some more problems with your code: you're calling non-static methods in a static context (the main method is static and seqSearch isn't). You're also using "n" before you declare it, which is probably a problem.
    And this makes no sense:z=2*i;because you've declared z to be an array; you can't use the multiplication operator on an array. It's not clear really what you're trying to accomplish there.
    Here's what I want you to do. Take your code and completely remove the binSearch method. Just rip it out. Then in your main() method, take out all references to the binSearch method, and all references except for the first one of the seqSearch method. Fix the things I mentioned above.
    Then try to compile what you have. It won't compile. You will get error messages. That's OK. Just fix them and move on. If you don't understand an error message, ask on these forums (DON'T CROSSPOST), quoting the full error message and the relevant lines of code.
    After a couple hours, you'll fix the syntactical bugs, and your program will compile. Then you'll find that it compiles but the program doesn't work right. That's also OK. This is how computer programming works. It's part of the process. Don't panic. At that point, you can start trying to fix the program so it does what it's supposed to. Eventually you'll get it to work.
    Then, and only then add more invocations of the seqSearch method. They won't all work, probably. You'll find more bugs. That's OK. Just repeat the process of fixing them.
    When you've fixed those bugs, then, and only then, add the binSearch method. Repeat the process of fixing syntax and hunting down and fixing bugs.
    Then your program will work.

  • Need help on this program

    Hi all,
    The purpose of this program is listed in here:
    // Inputs the miles driven and gallons used (both integers) for each tankful.
    // Calculates and displays miles per gallon obtained for each tankful and print
    // the combined miles per gallon obtained for all tankfuls up to this point.
    // All results should be floating point. Use Scanner and sentinel-controlled
    // repetition to obtain data from the user.
    // Exercise 4.17 MPG.java
    import java.util.Scanner;
    public class MPG
    private int milesDriven;
    private int gallonsUsed;
    private float result;
    public void setMilesDriven( int miles )
    milesDriven = miles;
    public void setGallonsUsed( int gallons )
    gallonsUsed = gallons;
    public String getMilesDriven( int miles )
    return milesDriven; // error occurs here
    public String getGallonsUsed( int gallons )
    return gallonsUsed;
    public MPG( float result )
    result = gallons * miles;
    System.out.printf( result);
    I try to compile this program, but the error I get is "incompatible types-found int but expected java.lang.String." How do I fix this, and how do I
    use sentinel control? If you can help me with these two things, I'd appreciate it. The sooner you can help me, the better.

    When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.
    I try to compile this program, but the error I get is
    "incompatible types-found int but expected
    java.lang.String." That means you provided an int where the program expected a string. Just like it says.
    How do I fix this,Either provide a String instead of the int, or change the code that's expecting a String to operate on an int instead.
    and how do I
    use sentinel control? II assume the instructor just wants a flag that indicates whether you're done or not. If the user enters "quit" or whatever, set that flag to true. The loop control ( while(whatever), for example) checks the flag, and either enters the loop or not.
    The sooner you can
    help me, the better.I'd advise you to keep comments like this out of your future posts. Nobody here cares about your timetable. We answer questions on our own schedule, and comments like that, and "urgent" and "asap" just annoy people.

  • I need help getting this program to work.

    K. I don't pay much attention in my AP Comp Science Class.. but my teacher said if i can get this program to work i get an a for the semester... The program is Metrowerks Codewarrior IDE.. we are running it on windows 98 i think. She said she can't get it to compile.. so i guess it just needs to be able to input simple java programs (i.e. loops, just the regular crap) and compile them and run them...i have no clue what is wrong with it.. it could just need a patch...or we may just be going about it the wrong way...any help would be SUPER appreciated...

    K. I don't pay much attention in my AP Comp Science
    Class.. but my teacher said if i can get this programYou better did.
    to work i get an a for the semester... The program is
    Metrowerks Codewarrior IDE.. we are running it on
    windows 98 i think. She said she can't get it toAtleast be sure of the OS.
    compile.. so i guess it just needs to be able to
    input simple java programs (i.e. loops, just the
    regular crap) and compile them and run them...i have
    no clue what is wrong with it.. it could just need aEven we don't.
    patch...or we may just be going about it the wrong
    way...any help would be SUPER appreciated...Nothing in your thread really speaks of the problem. And since you mentioned homework, there's hardly anyone to be interested in that.
    Regards
    ***Annie***

  • Please help me this program

    Please help me with this program,the progarm should operates as follows
    1)Calculate the number of words
    2)Calculate the number of sentences
    3)Calculate the repeated words
    * Title: <p>
    * Description: <p>
    * Copyright: Copyright (c) cds<p>
    * Company: s<p>
    * @author cds
    * @version 1.0
    package count;
    import java.awt.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import com.borland.jbcl.layout.*;
    import javax.swing.border.*;
    import java.util.StringTokenizer;
    public class Frame1 extends JFrame {
    JPanel jPanel1 = new JPanel();
    XYLayout xYLayout1 = new XYLayout();
    XYLayout xYLayout2 = new XYLayout();
    JScrollPane jScrollPane1 = new JScrollPane();
    JTextArea jta1 = new JTextArea();
    JScrollPane jScrollPane2 = new JScrollPane();
    JTextArea jta2 = new JTextArea();
    JLabel jLabel1 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JButton jbtCountSentances = new JButton();
    JButton jbtCountWords = new JButton();
    JButton jbtRWords = new JButton();
    JButton jbtClearList = new JButton();
    JTextField jtfNumOfSentances = new JTextField();
    JLabel jLabel3 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JTextField jtfNumOfWords = new JTextField();
    private JFileChooser jFileChooser = new JFileChooser();
    public static String sentence,RepeatedWords,repwords,chr=" ";
         public static int i,words,token,periods,characters,len,long_word,long_sent,stop;
    //Construct the frame
    public Frame1() {
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    }setSize(600,400);
    show();
    public static void main(String[] args) {
    Frame1 frame1 = new Frame1();
    private void jbInit() throws Exception {
    jPanel1.setLayout(xYLayout1);
    this.getContentPane().setLayout(xYLayout2);
    jLabel1.setForeground(Color.blue);
    jLabel1.setText(" Type your Doc");
    jLabel2.setForeground(Color.blue);
    jLabel2.setText(" Reapeated Words");
    jbtCountSentances.setBackground(Color.white);
    jbtCountSentances.setForeground(Color.blue);
    jbtCountSentances.setText("Count Sentances");
    jbtCountSentances.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jbtCountSentances_actionPerformed(e);
    jbtCountWords.setBackground(Color.white);
    jbtCountWords.setForeground(Color.blue);
    jbtCountWords.setText("Count Words");
    jbtCountWords.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jbtCountWords_actionPerformed(e);
    jbtRWords.setBackground(Color.white);
    jbtRWords.setForeground(Color.blue);
    jbtRWords.setText("Reapeted Words");
    jbtRWords.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jbtRWords_actionPerformed(e);
    jbtClearList.setBackground(Color.white);
    jbtClearList.setForeground(Color.blue);
    jbtClearList.setText("Clear");
    jbtClearList.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jbtClearList_actionPerformed(e);
    jLabel3.setForeground(Color.blue);
    jLabel3.setText("NumOfSentances");
    jLabel4.setForeground(Color.blue);
    jLabel4.setText("NumOfWords");
    jPanel1.setBackground(SystemColor.activeCaption);
    jPanel1.setForeground(SystemColor.activeCaption);
    this.getContentPane().add(jPanel1, new XYConstraints(4, 4, 986, 469));
    jPanel1.add(jScrollPane1, new XYConstraints(5, 105, 289, 192));
    jScrollPane1.getViewport().add(jta1, null);
    jPanel1.add(jScrollPane2, new XYConstraints(309, 102, 256, 193));
    jScrollPane2.getViewport().add(jta2, null);
    jPanel1.add(jLabel1, new XYConstraints(21, 81, 240, 22));
    jPanel1.add(jLabel2, new XYConstraints(340, 78, 191, 20));
    jPanel1.add(jbtCountSentances, new XYConstraints(69, 309, 190, 30));
    jPanel1.add(jbtCountWords, new XYConstraints(69, 339, 190, 24));
    jPanel1.add(jbtClearList, new XYConstraints(262, 337, 173, 26));
    jPanel1.add(jbtRWords, new XYConstraints(262, 310, 174, 24));
    jPanel1.add(jLabel3, new XYConstraints(14, 37, 105, 20));
    jPanel1.add(jtfNumOfSentances, new XYConstraints(114, 37, 64, 23));
    jPanel1.add(jLabel4, new XYConstraints(212, 38, 82, 23));
    jPanel1.add(jtfNumOfWords, new XYConstraints(304, 35, 83, 27));
    void jbtCountSentances_actionPerformed(ActionEvent e) {
    BufferedReader stdin = new BufferedReader
                   (new InputStreamReader (System.in));
    sentence = jta1.getText();
              System.out.flush ();
              len=sentence.length();
    jtfNumOfSentances.setText(String.valueOf(num_periods()));
    public static int num_periods () {
              i=0;
              periods=3;
              chr= ".";
    chr= "!";
    chr= "?";
              while (i<len){
                   if (sentence.charAt(i)==chr.charAt(0))
                        periods++;
                   i++;
         return periods;
         }//Method num_words
    void jbtCountWords_actionPerformed(ActionEvent e) {
    String s = jta1.getText();
    StringTokenizer st = new StringTokenizer(s);
    jtfNumOfWords.setText(String.valueOf(st.countTokens()));
    void jbtRWords_actionPerformed(ActionEvent e) {
    repwords = jta1.getText();
    StringTokenizer st = new StringTokenizer(repwords);
              while (st.hasMoreTokens())
    RepeatedWords = st.nextToken(st.toString()) ;
         jta2.append(RepeatedWords);
         //}//Method num_words
    /*void jbtClearList_actionPerformed(ActionEvent e) {
    jta2.setText(null);
    void jbtHelp_actionPerformed(ActionEvent e) {
    jta1.append("Please open a File Write a document");
    // JScrollPane jScrollPane1 = new JScrollPane();
    //JTextArea jta1 = new JTextArea();
    // JScrollPane jScrollPane2 = new JScrollPane();
    //JTextArea jta2 = new JTextArea();
    void jbtClearList_actionPerformed(ActionEvent e) {
    jta2.setText(null);
    jta1.setText(null);
    jtfNumOfWords.setText(null);
    jtfNumOfSentances.setText(null);

    Let me try specify the main problem in details
    The code that i had posted displays an interface consisting of a 2 textarea.
    The first textarea is for a user to enter a sentence and the second is for displaying duplicated words.
    The program should allow the user to enter a sentence on the first textarea and when JButton named showduplicatedwords pressed it must display the words that are being duplicated in the sentence on the second textarea.And again count the number of sentence available when
    JButton countsentence is pressed

  • Help w/ this program

    can someone tell me whats wrong with this program? It's in my programming book and i can't get it to work.
    class Sundae {
    private Sundae() {}
    static Sundae makeASundae() {
    return new Sundae();
    public class IceCream {
    public static void main(String[] args) {
    Sundae x = new Sundae.makeASundae();
    I end up getting one of these things ^ under the period in Sundae.makeASundae(). Can you help me??

    you are calling a static method, so you should not do : Sundae x = new Sundae.makeASundae();
    but do:
    Sundae x = Sundae.makeASundae();
    instead
    cheers

  • I need help with this program ( Calculating Pi using random numbers)

    hi
    please understand that I am not trying to ask anymore to do this hw for me. I am new to java and working on the assignment. below is the specification of this program:
    Calculate PI using Random Numbers
    In geometry the ratio of the circumference of a circle to its diameter is known as �. The value of � can be estimated from an infinite series of the form:
    � / 4 = 1 - (1/3) + (1/5) - (1/7) + (1/9) - (1/11) + ...
    There is another novel approach to calculate �. Imagine that you have a dart board that is 2 units square. It inscribes a circle of unit radius. The center of the circle coincides with the center of the square. Now imagine that you throw darts at that dart board randomly. Then the ratio of the number of darts that fall within the circle to the total number of darts thrown is the same as the ratio of the area of the circle to the area of the square dart board. The area of a circle with unit radius is just � square unit. The area of the dart board is 4 square units. The ratio of the area of the circle to the area of the square is � / 4.
    To simuluate the throwing of darts we will use a random number generator. The Math class has a random() method that can be used. This method returns random numbers between 0.0 (inclusive) to 1.0 (exclusive). There is an even better random number generator that is provided the Random class. We will first create a Random object called randomGen. This random number generator needs a seed to get started. We will read the time from the System clock and use that as our seed.
    Random randomGen = new Random ( System.currentTimeMillis() );
    Imagine that the square dart board has a coordinate system attached to it. The upper right corner has coordinates ( 1.0, 1.0) and the lower left corner has coordinates ( -1.0, -1.0 ). It has sides that are 2 units long and its center (as well as the center of the inscribed circle) is at the origin.
    A random point inside the dart board can be specified by its x and y coordinates. These values are generated using the random number generator. There is a method nextDouble() that will return a double between 0.0 (inclusive) and 1.0 (exclusive). But we need random numbers between -1.0 and +1.0. The way we achieve that is:
    double xPos = (randomGen.nextDouble()) * 2 - 1.0;
    double yPos = (randomGen.nextDouble()) * 2 - 1.0;
    To determine if a point is inside the circle its distance from the center of the circle must be less than the radius of the circle. The distance of a point with coordinates ( xPos, yPos ) from the center is Math.sqrt ( xPos * xPos + yPos * yPos ). The radius of the circle is 1 unit.
    The class that you will be writing will be called CalculatePI. It will have the following structure:
    import java.util.*;
    public class CalculatePI
    public static boolean isInside ( double xPos, double yPos )
    public static double computePI ( int numThrows )
    public static void main ( String[] args )
    In your method main() you want to experiment and see if the accuracy of PI increases with the number of throws on the dartboard. You will compare your result with the value given by Math.PI. The quantity Difference in the output is your calculated value of PI minus Math.PI. Use the following number of throws to run your experiment - 100, 1000, 10,000, and 100,000. You will call the method computePI() with these numbers as input parameters. Your output will be of the following form:
    Computation of PI using Random Numbers
    Number of throws = 100, Computed PI = ..., Difference = ...
    Number of throws = 1000, Computed PI = ..., Difference = ...
    Number of throws = 10000, Computed PI = ..., Difference = ...
    Number of throws = 100000, Computed PI = ..., Difference = ...
    * Difference = Computed PI - Math.PI
    In the method computePI() you will simulate the throw of a dart by generating random numbers for the x and y coordinates. You will call the method isInside() to determine if the point is inside the circle or not. This you will do as many times as specified by the number of throws. You will keep a count of the number of times a dart landed inside the circle. That figure divided by the total number of throws is the ratio � / 4. The method computePI() will return the computed value of PI.
    and below is what i have so far:
    import java.util.*;
    public class CalculatePI
      public static boolean isInside ( double xPos, double yPos )
         double distance = Math.sqrt( xPos * xPos + yPos * yPos );        
      public static double computePI ( int numThrows )
        Random randomGen = new Random ( System.currentTimeMillis() );
        double xPos = (randomGen.nextDouble()) * 2 - 1.0;
        double yPos = (randomGen.nextDouble()) * 2 - 1.0;
        int hits = 0;
        int darts = 0;
        int i = 0;
        int areaSquare = 4 ;
        while (i <= numThrows)
            if (distance< 1)
                hits = hits + 1;
            if (distance <= areaSquare)
                darts = darts + 1;
            double PI = 4 * ( hits / darts );       
            i = i+1;
      public static void main ( String[] args )
        Scanner sc = new Scanner (System.in);
        System.out.print ("Enter number of throws:");
        int numThrows = sc.nextInt();
        double Difference = PI - Math.PI;
        System.out.println ("Number of throws = " + numThrows + ", Computed PI = " + PI + ", Difference = " + difference );       
    }when I tried to compile it says "cannot find variable 'distance' " in the while loop. but i thought i already declare that variable in the above method. Please give me some ideas to solve this problem and please check my program to see if there is any other mistakes.
    Thanks a lot.

    You've declared a local variable, distance, in the method isInside(). The scope of this variable is limited to the method in which it is declared. There is no declaration for distance in computePI() and that is why the compiler gives you an error.
    I won't check your entire program but I did notice that isInside() is declared to be a boolean method but doesn't return anything, let alone a boolean value. In fact, it doesn't even compute a boolean value.

  • Hello, need a little help with this program

    i have this program and i cant see whats wrong with it. but when i run it the error "Exception in thread 'main' java.lang.NoSuchMethodError: main"
    anyone know what wrong?
    class Assignment2
       public final
       void main( String[] argv )
           Script sc = new Script ("Assignment2.txt");
           KeyboardReader kb = new KeyboardReader();
         System.out.println( "Enter Time In 24hr Mode (use -999 to quit) : " );
         int time = kb.getInt();
         if (time == -999) {     System.out.println( "EXIT" );}
         System.out.println( "" );
         System.out.println( "Enter The Distance Of The Call (use -999 to quit) : " );
         int distance = kb.getInt();
         if (distance == -999) {     System.out.println( "EXIT" );}
           System.out.println( "" );
         System.out.println( "Enter Length Of Call In Minutes (use -999 to quit) : " );
         double length = kb.getDouble();
         if (length == -999) {System.out.println( "EXIT" );}     
           System.out.println( "" );
           Calculation (time, distance, length);
       }// end main
    public void Calculation (int time, int distance, double length)
              while (time != -999 || distance != -999 || length != -999)
                   if (700 <= time && time <= 1900 && distance <= 100)
                          System.out.println( "Cost of call is $0.60 per minute" );
                          double cost = 0.60 * length;
                          System.out.println( "That call will cost $ " + cost );
                     if  (700 <= time && time <= 1900 && distance > 100)
                          System.out.println( "Cost of call is $1.10 per minute" );
                          double cost = 1.10 * length;
                          System.out.println( "That call will cost $ " + cost );
                     if  (700 <= time && time <= 1900 && distance > 100)
                          System.out.println( "Cost of call is $1.10 per minute" );
                          double cost = 1.10 * length;
                          System.out.println( "That call will cost $ " + cost );
                System.out.println( "EXIT" );            
      }//end calculation
    }//end class
    //----------------------------------------------------------------------------------------------------

    i have this program and i cant see whats wrong with
    it. but when i run it the error "Exception in thread
    'main' java.lang.NoSuchMethodError: main"
    anyone know what wrong?When you get exceptions you also get a stack trace pointing you at the exact line where the exception occured in your code.

  • How can I fade in/out audio only below a certain frequency?

    I have an MP3 made from a MIDI file in which all instruments are unfortunately in a single track. I want to fade the tom part in because I thought it would be easy considering its obvious separation from the marimba part in the Spectral Pitch Display. How can I fade in these lower sounds only without affecting the higher marimba sound?

    You need to go back to the MIDI file and adjust the level there - you can't do this after the event unless you use something like the incredibly expensive Melodyne. This can achieve harmonically related event isolation, which Audition doesn't do. Toms don't just exist at one frequency; they have a harmonic spectrum and if you don't capture all of the harmonics, you won't be able to alter the relative level of all of them - which is what you'd need to do. Otherwise it will sound completely wrong.

  • This is how I fixed wifi greyed out on iPhone 4S

    It happened to me during a trip to Finland, wifi could not be switched on any more after iOS7.1 update, it was greyed out in control panel, I was not able to use hotel wifi, ... that cost me some Euros. Later I found, bluetooth also not working.
    But at home, after running a factory reset with iTunes with no success, I finally found the fix with google, my wifi is now working again ! Lets see, how long it lasts. Its 2 weeks now.
    Solution, and this is not a joke:
    -Place the iPhone on a soft towel or so and keep it switched on.
    -Heat it slowly with a hair dryer from the side with the earphone plug.
    -After a few minutes, it warns "temperature" and turns itself off.
    -Let it cool down. You then can switch it on (wifi still not working).
    -Reboot now by holding home and on buttons until the Apple logo comes back. Thats it !
    My iPhone 4S straight away connected to my home wifi......and still does for a couple of days now. Also some guys in this forum confirmed that trick to work.
    I try to help with this, but you do it at your own risk. On my friends iPhone 4 this did not help.
    I suspect, that it has something to do with the control panel. The error occured after switching wifi and flight mode from there. Currently I do only use the settings app for that. Can anybody confirm that ?

    You can also try calling Apple per the article posted, or go to another Apple Store, but if you wifi is grey and those steps don't fix it, you will need service (replacement).  Sorry, magic wand is out of batteries and pixie dust is depleted.
    Good Luck.

Maybe you are looking for

  • After Blue screen with Error B864F472, a blinking display after several minutes ( Type HP-6510e)

    Hi all, After, bout 30 minutes my HP-6510 display is blinking, including the wireless and powerbutton. All together at th e same time, in the same frequentie. Only thing i can do is push the powerbutton, then it will come bach normally and you can pr

  • SWC buttons not working in a Flash Builder 4.7 ActionScript Project

    Howdy, I have this BIG issue. Every button in my swc causes issues when compilling in Flash Builder 4.7. Two things will happen, one or the other: 1. I get this error in the class that extends a linked library item: Error #1107: The ABC data is corru

  • Working with raw photos

    I just got Photoshop CS6 and it will not open up my raw photos, and I do not see a Camera Raw program to open even it is a choice in the Bridge?

  • Excel 2007 query problems

    Has anyone else noticed problems with Excel 2007 when doing webqueries? We have someone who wrote a bunch of VBA in an excel document (excel 2003) that does 7 web queries, and then creates pivot tables on the results. Because of the row limitations i

  • Pages being overbearing. Help required

    Having just upgraded from Mountain Lion to Mavericks (10.9.2), I've come across a problem and wonder if anyone else is having the same issue. I'm currently working in Libre Office on one aspect of a project. I opened Pages up for the first time since