Results 1 to 3 of 3
  1. #1
    trilla is offline Member
    Join Date
    Nov 2013
    Posts
    9
    Rep Power
    0

    Unhappy Need Help. Super Urgent. Comparing Sounds and Arrays. Please....

    Considering at my lecture prior to receiving this assignment we were discussing how to create new projects in Java I feel a bit overwhelmed by what this problem is asking me to do.

    So I'm given this .java file "Animalsounds.java" along with "StdAudio.java" (which is this huge amount of code that I wont post as I only have to edit the Animalsounds.java code)
    (There are 3 animal sound files a dolphin, a bear, and an unknown animal (named dolphin, bear, unknown accordingly)



    Java Code:
    package animalsounds;
    
    import java.io.File;
    import java.io.IOException;
    import java.util.Scanner;
    
    /**
      *
      * @author user
      */
    
       public class AnimalSounds{
           /**
              * @param args the command line arguments
              */
    
              public static void main(String[] args) throws IOException {
                    Scanner scanner =
                                new Scanner(new File(args[0]));
                        //TODO code application logic here
                        int i = 0;
                        double [] sound = new double [100900];
                        while(scanner.hasNext())
                        {
                              sound[i] = scanner.nextDouble();
                              i = i +1;
                        }
                        Std.Audio.play(sound);
                }
    }
    and I have to:

    1.)Change the number of command line arguments to handle 3 files instead of 1. These files include the sample of each sin wave for each animal sound.
    2.)Create a function called calcDifference that takes three arguments the arrays of data to compare and the number of samples in those arrays and returns the difference between those arrays. The return type for the function should be a double. Your main function will need to call this function twice.
    3.)Check the outputs of the calcDifference to determine the identity of the animal in the unknown file. If you listen to the file, the identity will be less obvious.
    4.)Print the identity of the known animal using System.out.println.


    please someone I need this. I feel totally helpless and overhwhelmed. About to have a nervous breakdown
    Last edited by trilla; 11-01-2013 at 07:36 AM.

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,105
    Rep Power
    6

    Default Re: Need Help. Super Urgent. Comparing Sounds and Arrays. Please....

    You need some psychological help then, you won't find that here.

    If you are feeling overwhelmed you are trying to do too much while knowing too little. There is only one thing to do; study your butt off and take it one step at a time. So start with step 1, and don't start with hammering out code. Start by thinking about it. Apparently the code as it is now handles only one file. Now look at the code. What line proves that and why?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    trilla is offline Member
    Join Date
    Nov 2013
    Posts
    9
    Rep Power
    0

    Default Re: Need Help. Super Urgent. Comparing Sounds and Arrays. Please....

    Quote Originally Posted by gimbal2 View Post
    You need some psychological help then, you won't find that here.

    If you are feeling overwhelmed you are trying to do too much while knowing too little. There is only one thing to do; study your butt off and take it one step at a time. So start with step 1, and don't start with hammering out code. Start by thinking about it. Apparently the code as it is now handles only one file. Now look at the code. What line proves that and why?
    Thanks.

Similar Threads

  1. Comparing arrays if statement Help !
    By steveday77 in forum New To Java
    Replies: 2
    Last Post: 04-30-2013, 10:27 PM
  2. comparing 2 arrays to see if they're equal
    By Get_tanked in forum New To Java
    Replies: 2
    Last Post: 02-17-2011, 06:59 AM
  3. Comparing arrays
    By mitty in forum New To Java
    Replies: 8
    Last Post: 04-14-2010, 11:55 AM
  4. comparing arrays..
    By circuspeanuts in forum New To Java
    Replies: 5
    Last Post: 05-25-2009, 07:05 AM
  5. Combining Individual Sounds - Urgent
    By JDCAce in forum Advanced Java
    Replies: 4
    Last Post: 12-05-2008, 05:17 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •