Announcement

Collapse
No announcement yet.

Song Search

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Song Search

    main
    PHP Code:
    import search.search_song;


    /**
     * Created with xgiovio.macbookair.
     * User: xgiovio
     * Date: 23/09/13
     * Time: 14:57
     */



    public class test {

        public static 
    void main (String [] input_datathrows Exception {

            
    search_song.name_print_song("library.dat","Francesco");

        }

    class
    PHP Code:
    package search;

    import java.io.File;
    import java.util.Scanner;

    /**
     * Created with xgiovio.macbookair.
     * User: xgiovio
     * Date: 15/10/13
     * Time: 14:31
     */
    public class search_song {


            public static  
    void name_print_song (String libraryString name_to_searchthrows Exception{

                
    String temp;
                
    boolean print = false;
                
    Scanner lettore = new Scanner(new File(library));
                    for( ;
    lettore.hasNextLine(); ) {
                            
    temp lettore.nextLine();
                            if (
    temp.equals(name_to_search)){
                                
    System.out.println("Artist: " name_to_search " - Song: " lettore.nextLine());
                                print = 
    true;
                            }else{
                                
    lettore.nextLine();
                            }
                    }
                    if (!print) {
                        
    System.out.println("No song found for " name_to_search );
                    }
            }

    | VFX Artist, C++ Programmer, HW Overclocker | Web: xgiovio.com Email: xgiovio@gmail.com Twitter: @xgiovio
Working...
X

Google Profile


My name is Giovanni Di Grezia, but people call me xgiovio.

Here is my homepage:.

I'm a VFX Artist and Software Developer.

Giovanni Di Grezia