Homework Solution: Java cant read my file, only showing "No such file was found"…

    Java cant read my file, only showing "No such file was found" import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.*; public class Artists { private String artistName; private int artistID; /** constructor for Artist*/ public Artists(int ID, String artists) { setArtistID(artistID = ID); setArtistName(artistName = artists); } /** toString method */ public String toString() { return getArtistID() + " " + getArtistName(); } /** getter for artist name*/ private String getArtistName() { return artistName; } /** setter for artist name*/ private void setArtistName(String newName) { artistName = newName; } /** getter for artist ID*/ private int getArtistID() { return artistID; } /** setter for artist ID*/ private void setArtistID(int newID) { artistID = newID; } public static void main(String[] args) { ArrayList<Artist> myList = new ArrayList<Artist>(); int artistCounter = 0; String[] artistNameArray = new String[116]; try //File file = new File("plartists.txt"); //Scanner input = new Scanner(file); { Scanner input = new Scanner(new File("p1artists.txt")); File Myfile = new File("p1artists_out.txt"); PrintWriter output = new PrintWriter(Myfile); int i = 0; while (input.hasNext()) { artistCounter++; try { int artistID = input.nextInt(); String artistName = input.next(); artistNameArray[i] = artistName; output.println(artistID + " " + artistName); i++; } catch (InputMismatchException e) { input.next(); } } output.close(); input.close(); } catch (FileNotFoundException e) { System.out.println("No such file was found"); } /**Write all to new file*/ int j = 0; int artCounter = 0; int totalAppraised = 0;   try { Scanner input = new Scanner(new File("p1arts.txt")); File File = new File("p1arts_out.txt"); PrintWriter output = new PrintWriter(File); while (input.hasNext()) { try { String[] splitArray = input.nextLine().split("t"); output.printf("%st%st%st%st%sn", splitArray[0], splitArray[1], splitArray[2], artistNameArray[j], splitArray[3]); totalAppraised += Integer.parseInt(splitArray[3]); j++; artCounter++; } catch (InputMismatchException e) { input.next(); } } output.close(); input.close(); } catch (FileNotFoundException e) { System.out.println("No such file was found"); } /**Totals*/ int finalArtistCount = artistCounter-1; System.out.println("nTotal artists: " + finalArtistCount); System.out.println("Total amount of artwork: " + artCounter); System.out.println("Total appraised value of all artwork: $" + totalAppraised); } } ----------------------------------------------------------------------------------------------- This is my project Description: 1.) In this part, we are going to apply the concepts of Bag Interface to Online Shopping Cart. If you examine the Listing 1-2 program, you will find that the program is not complete and the type Item is missing. 2.)In designing interactive application like shopping activities, it is desirable to have the test data stored in a file to speed up the testing time. Therefore, to prepare for the future project, we need to get used to file I/O in Java. 3)There is a tab-delimited text file named “p1artists.txt” which is to be used as an input file. Each record consists of the following two fields: a) artistID: integer. b) artistName: String; Assignment: A) Refer to the sample program of Listing 1-2 on pages 41 and 42, instead of Item class, implement the Artist class that contains the following: 1.) The 2 fields mentioned above in “p1artists.txt” file. 2.)The Constructor that accepts the 2 fields when the record of an artist is created. 3.) Getters and setters for the 2 fields. 4.) The toString() method. 5. )Test the program with the following data.
    ArtistID Artist Name
    1 Acconci
    2 Ames
    3 Aserty
    4 Baron
    5 Battenberg
    B) Modify the above program according to the following: 1.) Read the input file “p1artists.txt” instead of hardcoding the values. 2.) Use the exception handler to ensure that artist ID is numeric. 3.) If the input is incorrect, print the line number and its contents, but do not stop. 4.) Send the output to a text file named “p1artists_out1.txt”. C) Enhance the above program for the following: 1.) A tab-delimited text file named “p1arts.txt” contains the following record formats:
    ArtID Title ArtistID Appraised Value
    1001 Red Rock Mountain 50 18000
    1002 Offerings 52 10000
    1003 Spring Flowers 12 2400
    2.) Assume that this file contains no error. You are going to read “p1artists.txt” into an array, and then process “p1arts.txt” to add the artist name to the output. Name this output file “p1arts_out.txt”. Example follows:
    ArtID Title Artist ArtistID Appraised Value
    1001 Red Rock Mountain Mogan 50 18000
    1002 Offerings Novarre 52 10000
    1003 Spring Flowers Chico 12 2400
    3.)Use an exception handler if the ArtistID does not exist in the “p1artists.txt” file. However, you still need to write this record to the output file. 4.)In the end, include the total number of the Art Works and Artists, and the total appraised value. --------------------------------------------------------------------------------------------------------------------------------------- Listing 1-2 CODE public class OnlineShopper { public static void mian (String[] args) { Item[] items = { new Item("Bird feeder", 2050), new Item("Squirrel guard", 1547), new Item("Bird bath", 4499), new Item("Sunflower seeds", 1295)}; BagInterface<Item> shoppingCart = new Bag<>(); int totalCost = 0; for (int index = 0; index < items.length; index++) { Item nextItem = items[index]; shoppingCart.add(nextItem); totalCost = totalCost + nextItem.getPrice(); } while (!shoppingCart.isEmpty()) System.out.println(shoppingCart.remove()); System.out.println("Total cost: " + "t$" + totalCost / 100 + " . " + totalCost % 100); } } Sample Output Sunflower seeds   $12.95 Bird Bath $44.99 Squirrel guard $15.47 Bird feeder $20.50 Total cost: $93.91 ------------------------------------------------------------------------------------------------------------------------------------------------------ p1arts.txt
    1001    Red Rock Mountain       50      18000
    1002    Offerings       52      10000
    1003    Spring Flowers  12      2400
    1004    Seeking Shelter 64      52000
    1005    The Hang        18      8000
    1006    House Remembered        32      700
    1007    Homage to the Ancestors 82      1200
    1008    End of the Path 26      1900
    1009    Amen    28      3000
    1010    Untitled (land with adobe)      71      800
    1011    Eve     19      975
    1012    Man on Horseback        74      8000
    1013    Superstitions   3       78000
    1014    Plenty  45      500
    1015    Punch   46      10000
    1016    Untitled        65      6000
    1017    Brittlecone     6       1300
    1018    Mountain Scene  8       2500
    1019    The White Heart 61      9300
    1020    Untitled (Man holding coat)     73      3000
    1021    Bead Wall       3       14000
    1022    The Cowboy      69      4200
    1023    Shooting the Rapids     47      1300
    1024    Spirit and Nature       48      592
    1025    Profile of a Woman      68      625
    1026    Untitled (couple)       66      4000
    1027    Mountain Climber        47      4700
    1028    Tired Cowboy    50      4700
    1029    Horseshoe Falls 31      15000
    1030    Ash Bench       28      13000
    1031    Inside/Out      34      3500
    1032    Rising Sun      42      2000
    1033    Untitled (Woman abstract)       77      2500
    1034    Beaver Pole Jumble      3       28000
    1035    Nature/Nurture  47      1300
    1036    Blackhawk       5       25500
    1037    Floating World  21      2350
    1038    Spring Flowers  1       800
    1039    Treachery       14      20000
    1040    Night on the Praire     47      1300
    1041    Night Version   29      3800
    1042    Coffee on the Trail     2       7544
    1043    Creosote Bushes 28      18000
    1044    Mexican Fiesta  43      14000
    1045    Leaf Patterns   38      2100
    1046    Immediate Gratification 33      1500
    1047    Medicine Man    44      2500
    1048    Comfy Chair     57      800
    1049    Buttercup with Red Lip  7       400
    1050    Cattle Ranch    1       10000
    1051    Night Version   36      7000
    1052    American Rodeo  16      3500
    1053    Blue Eyed Indian        6       40000
    1054    Snake Charmer   50      4500
    1055    Starlit Evening 9       9500
    1056    Cavalry Is Coming       6       1900
    1057    Untitled        66      4500
    1058    The Gathering   60      250
    1059    Dwelling        17      16000
    1060    Story Sticks    42      650
    1061    Untitled Mural  78      3520
    1062    Cowboy and Saddle       41      18000
    1063    Asleep in the Garden    3       110000
    1064    Spirit Columns  51      7000
    1065    Moonlite        47      1300
    1066    Untitled (still life)   76      19500
    1067    Owl in Flight   49      7000
    1068    Moonlight       50      9750
    1069    Renaissance     50      5500
    1070    Beginnings      4       27500
    1071    Ride the Rapids 79      300
    1072    Funnel  24      4500
    1073    Dancing in the Light    15      4000
    1074    Storm on the Rise       55      8000
    1075    Western Boots and Spurs 6       6000
    1076    Ride the Bronco 79      1500
    1077    Bull Riding     6       5200
    1078    Chuckwagon      28      32000
    1079    Carrying the Mail       62      8000
    1080    The Dust Behind 59      18000
    1081    Coming Under Fire       13      650
    1082    Spring Flowers  29      20000
    1083    Untitled        64      2500
    1084    Crossing the Platt River        23      2200
    1085    Traces  63      20000
    1086    Untitled (desert landscape)     67      18000
    1087    Three Woman     81      20000
    1088    Lessons 37      3700
    1089    Life Lessons    53      4125
    1090    Off the Grid    11      8000
    1091    Stone Palette   54      11500
    1092    Dressing Up     47      1300
    1093    Antelopes       62      12500
    1094    Life Is Sweet   39      25000
    1095    The Spirit      61      20000
    1096    Ceremonial Sticks       10      15000
    1097    Untitled (Sea)  75      2800
    1098    Sweet Project   56      592
    1099    Watch That Rattler      20      900
    1100    Hungry Cowboys  38      750
    1101    The Red Door    58      10000
    1102    Crying Hats     14      10000
    1103    Trail End       1       8000
    1104    Untitled        70      1800
    1105    Meteor Show     80      10000
    1106    Horse Corral    40      12500
    1107    Striking It Rich        35      1750
    1108    Untitled Mural  77      400
    1109    Friends 22      16000
    1110    Three Sisters   62      6500
    1111    Untitled (man and crucifix)     72      3200
    1112    Dark Canyon     27      8000
    1113    Shadow House    50      5500
    1114    Storytelling at the Campfire    50      18000
    1115    Starry Night    25      8500
    1116    Apache Warrior  30      23000
    
    --------------------------------------------------------------------------------------------------------------------------- p1artist.txt
    1       Acconci
    2       Ames
    3       Aserty
    4       Baron
    5       Battenberg
    6       Bindner
    7       Blain
    8       Blum
    9       Budd
    10      Cardenas
    11      Carpenter
    12      Chico
    13      Colvin
    14      Cox
    15      Cridler
    16      Curtis
    17      Dawson
    18      DiGrigoro
    19      Dill
    20      Edwards
    21      Fleming
    22      Fratt
    23      Garber
    24      Garin
    25      Giama
    26      Gilhooly
    27      Gonzales
    28      Guys
    29      Hamend
    30      Higgins
    31      Hofmann
    32      Ibe
    33      Indiana
    34      Ingraham
    35      Irvin
    36      Kerrihard
    37      Kollasch
    38      Kritz
    39      Lerman
    40      Long
    41      Lowney
    42      Lundquist
    43      Lutes
    44      Maglich
    45      McGraw
    46      McIver
    47      Meglech
    48      Metz
    49      Miller
    50      Mogan
    51      Motherwell
    52      Novarre
    53      Odiezma
    54      Ortega
    55      Parker
    56      Penn
    57      Pierobon
    58      Prinzen
    59      Quiroz
    60      Rath
    
    --------------------------------------------------------------------------------------------------------------------------------------- p1artists-full.txt
    1       Acconci
    2       Ames
    3       Aserty
    4       Baron
    5       Battenberg
    6       Bindner
    7       Blain
    8       Blum
    9       Budd
    10      Cardenas
    11      Carpenter
    12      Chico
    13      Colvin
    14      Cox
    15      Cridler
    16      Curtis
    17      Dawson
    18      DiGrigoro
    19      Dill
    20      Edwards
    21      Fleming
    22      Fratt
    23      Garber
    24      Garin
    25      Giama
    26      Gilhooly
    27      Gonzales
    28      Guys
    29      Hamend
    30      Higgins
    31      Hofmann
    32      Ibe
    33      Indiana
    34      Ingraham
    35      Irvin
    36      Kerrihard
    37      Kollasch
    38      Kritz
    39      Lerman
    40      Long
    41      Lowney
    42      Lundquist
    43      Lutes
    44      Maglich
    45      McGraw
    46      McIver
    47      Meglech
    48      Metz
    49      Miller
    50      Mogan
    51      Motherwell
    52      Novarre
    53      Odiezma
    54      Ortega
    55      Parker
    56      Penn
    57      Pierobon
    58      Prinzen
    59      Quiroz
    60      Rath
    61      Reed
    62      Rissman
    63      Rogers
    64      Roman
    65      Schenck
    66      Scherzel
    67      Scholder
    68      Senior
    69      Shenal
    70      Statom
    71      Swartz
    72      Tidwell
    73      Turrell
    74      Udinotti
    75      Van Coller
    76      Waid
    77      Werner
    78      Wittner
    79      Wright
    80      Xie
    81      Yasami
    82      Zischke
    

    Expert Answer

     
    NOTE: Added a catch for IndexOutOfBound for missing data in the input file.

    Java patois unravel my polish, simply showing “No such polish was found”

    import java.io.File;

    import java.io.FileNotFoundException;

    import java.io.PrintWriter;

    import java.util.*;

    public dispose Professors

    {

    private String professorName;

    private int professorID;

    /** agent coercion Professor*/

    public Professors(int ID, String professors)

    {

    setArtistID(artistID = ID);

    setArtistName(artistDesignate = professors);

    }

    /** toString mode */

    public String toString()

    {

    return gainArtistID() + ” ” + gainArtistName();

    }

    /** gainter coercion professor designate*/

    private String gainArtistName()

    {

    return professorName;

    }

    /** setter coercion professor designate*/

    private nugatory setArtistName(String upstartName)

    {

    artistDesignate = upstartName;

    }

    /** gainter coercion professor ID*/

    private int gainArtistID()

    {

    return professorID;

    }

    /** setter coercion professor ID*/

    private nugatory setArtistID(int upstartID)

    {

    artistID = upstartID;

    }

    public static nugatory deep(String[] args)

    {

    ArrayList<Artist> myList = upstart AccoutreList<Artist>();

    int professorCounter = 0;

    String[] professorNameAccoutre = upstart String[116];

    try

    //Polish polish = upstart Polish(“plartists.txt”);

    //Scanner input = upstart Scanner(file);

    {

    Scanner input = upstart Scanner(upstart Polish(“p1artists.txt”));

    Polish Mypolish = upstart Polish(“p1artists_out.txt”);

    PrintWriter quenchedput = upstart StereotypeWriter(Myfile);

    int i = 0;

    while (input.hasNext())

    {

    artistCounter++;

    try

    {

    int professorID = input.nextInt();

    String professorDesignate = input.next();

    artistNameArray[i] = professorName;

    output.println(artistID + ” ” + professorName);

    i++;

    }

    lay-hold-on (InputMismatchQualification e)

    {

    input.next();

    }

    }

    output.close();

    input.close();

    }

    lay-hold-on (FileNotFoundQualification e)

    {

    System.out.println(“No such polish was found”);

    }

    /**Transcribe entire to upstart polish*/

    int j = 0;

    int artCounter = 0;

    int completionAppraised = 0;

     

    try

    {

    Scanner input = upstart Scanner(upstart Polish(“p1arts.txt”));

    Polish Polish = upstart Polish(“p1arts_out.txt”);

    PrintWriter quenchedput = upstart StereotypeWriter(File);

    while (input.hasNext())

    {

    try

    {

    String[] splinterAccoutre = input.nextLine().split(“t”);

    output.printf(“%st%st%st%st%sn”, splinterArray[0], splinterArray[1],

    splitArray[2], professorNameArray[j], splinterArray[3]);

    totalAppraised += Integer.parseInt(splitArray[3]);

    j++;

    artCounter++;

    }

    lay-hold-on (InputMismatchQualification e)

    {

    input.next();

    }

    }

    output.close();

    input.close();

    }

    lay-hold-on (FileNotFoundQualification e)

    {

    System.out.println(“No such polish was found”);

    }

    /**Totals*/

    int finalArtistCount = professorCounter-1;

    System.out.println(“nCompletion professors: ” + finalArtistCount);

    System.out.println(“Completion sum of artwork: ” + artCounter);

    System.out.println(“Completion appraised esteem of entire artwork: $” + completionAppraised);

    }

    }

    ———————————————————————————————–

    This is my plan

    Description:

    1.) In this portio, we are going to inferuce the concepts of Bag Interface to Oncourse Shopping Cart. If you touchstone the Listing 1-2 program, you integralure experience that the program is referable attributable attributable attributable finished and the character Item is detriment.

    2.)In wily interactive impression love shopping activities, it is acceptable to enjoy the touchstone axioms stored in a polish to hasten up the touchstoneing occasion. Therefore, to plan coercion the advenient plan, we scarcity to gain used to polish I/O in Java.

    3)There is a tab-delimited extract polish designated “p1artists.txt” which is to be used as an input polish. Each proceedings consists of the aftercited townssubject fields:

    a) professorID: integer.

    b) professorName: String;

    Assignment:

    A) Refer to the illustration program of Listing 1-2 on pages 41 and 42, instead of Item dispose, appliance the Professor dispose that contains the aftercited:

    1.) The 2 fields mentioned overhead in “p1artists.txt” polish.

    2.)The Agent that accepts the 2 fields when the proceedings of an professor is created.

    3.) Gainters and setters coercion the 2 fields.

    4.) The toString() mode.

    5. )Touchstone the program with the aftercited axioms.

    ArtistID Professor Designate
    1 Acconci
    2 Ames
    3 Aserty
    4 Baron
    5 Battenberg

    B) Modify the overhead program according to the aftercited:

    1.) Unravel the input polish “p1artists.txt” instead of hardcoding the esteems.

    2.) Use the qualification handler to determine that professor ID is numeric.

    3.) If the input is inaccurate, stereotype the course estimate and its contents, quiescent do referable attributable attributable attributable plug.

    4.) Sobject the quenchedput to a extract polish designated “p1artists_out1.txt”.

    C) Enhance the overhead program coercion the aftercited:

    1.) A tab-delimited extract polish designated “p1arts.txt” contains the aftercited proceedings coercionmats:

    ArtID Title ArtistID Appraised Esteem
    1001 Red Rock Mountain 50 18000
    1002 Offerings 52 10000
    1003 Spring Flowers 12 2400

    2.) Assume that this polish contains no untruth. You are going to unravel “p1artists.txt” into an accoutre, and then arrangement “p1arts.txt” to infer the professor designate to the quenchedput. Designate this quenchedput polish “p1arts_out.txt”. Example follows:

    ArtID Title Artist ArtistID Appraised Esteem
    1001 Red Rock Mountain Mogan 50 18000
    1002 Offerings Novarre 52 10000
    1003 Spring Flowers Chico 12 2400

    3.)Use an qualification handler if the ProfessorID does referable attributable attributable attributable depobject in the “p1artists.txt” polish. However, you quiescent scarcity to transcribe this proceedings to the quenchedput polish.

    4.)In the object, understand the completion estimate of the Art Works and Professors, and the completion appraised esteem.

    —————————————————————————————————————————————

    Listing 1-2 CODE

    public dispose OnlineShopper

    {

    public static nugatory mian (String[] args)

    {

    Item[] items = { upstart Item(“Bird feeder”, 2050),

    upstart Item(“Squirrel escort”, 1547),

    upstart Item(“Bird bath”, 4499),

    upstart Item(“Sunflower seeds”, 1295)};

    BagInterface<Item> shoppingCart = upstart Bag<>();

    int completionCost = 0;

    coercion (int abjuration = 0; abjuration < items.length; abjuration++)

    {

    Item proximateItem = items[index];

    shoppingCart.add(nextItem);

    totalCost = completionCost + proximateItem.getPrice();

    }

    while (!shoppingCart.isEmpty())

    System.out.println(shoppingCart.remove());

    System.out.println(“Completion cost: ” + “t$” + completionCost / 100 + ” . ” + completionCost % 100);

    }

    }

    Illustration Quenchedput

    Sunflower seeds   $12.95

    Bird Bath $44.99

    Squirrel escort $15.47

    Bird feeder $20.50

    Completion cost: $93.91

    ——————————————————————————————————————————————————

    p1arts.txt

    1001    Red Rock Mountain       50      18000
    1002    Offerings       52      10000
    1003    Spring Flowers  12      2400
    1004    Seeking Shelter 64      52000
    1005    The Hang        18      8000
    1006    House Remembered        32      700
    1007    Homage to the Ancestors 82      1200
    1008    Object of the Path 26      1900
    1009    Amen    28      3000
    1010    Untitled (fix with adobe)      71      800
    1011    Eve     19      975
    1012    Subject on Horseback        74      8000
    1013    Superstitions   3       78000
    1014    Plenty  45      500
    1015    Punch   46      10000
    1016    Untitled        65      6000
    1017    Brittlecone     6       1300
    1018    Mountain Scene  8       2500
    1019    The White Heart 61      9300
    1020    Untitled (Subject holding lure)     73      3000
    1021    Bead Wentire       3       14000
    1022    The Cowboy      69      4200
    1023    Shooting the Rapids     47      1300
    1024    Spirit and Nature       48      592
    1025    Propolish of a Wosubject      68      625
    1026    Untitled (couple)       66      4000
    1027    Mountain Climber        47      4700
    1028    Tired Cowboy    50      4700
    1029    Horseshoe Falls 31      15000
    1030    Ash Bench       28      13000
    1031    Inside/Quenched      34      3500
    1032    Rising Sun      42      2000
    1033    Untitled (Wosubject unembodied)       77      2500
    1034    Beaver Pole Jumble      3       28000
    1035    Nature/Nurture  47      1300
    1036    Blackhawk       5       25500
    1037    Floating World  21      2350
    1038    Spring Flowers  1       800
    1039    Treachery       14      20000
    1040    Night on the Praire     47      1300
    1041    Night Version   29      3800
    1042    Coffee on the Trail     2       7544
    1043    Creosote Bushes 28      18000
    1044    Mexican Fiesta  43      14000
    1045    Leaf Patterns   38      2100
    1046    Immediate Gratification 33      1500
    1047    Medicine Subject    44      2500
    1048    Comfy Chair     57      800
    1049    Quiescenttercup with Red Lip  7       400
    1050    Cattle Ranch    1       10000
    1051    Night Version   36      7000
    1052    American Rodeo  16      3500
    1053    Blue Eyed Indian        6       40000
    1054    Snake Charmer   50      4500
    1055    Starlit Evening 9       9500
    1056    Cavalry Is Coming       6       1900
    1057    Untitled        66      4500
    1058    The Gathering   60      250
    1059    Dwelling        17      16000
    1060    Story Sticks    42      650
    1061    Untitled Mural  78      3520
    1062    Cowboy and Saddle       41      18000
    1063    Asleep in the Garden    3       110000
    1064    Spirit Columns  51      7000
    1065    Moonlite        47      1300
    1066    Untitled (quiescent existence)   76      19500
    1067    Owl in Flight   49      7000
    1068    Moonlight       50      9750
    1069    Renaissance     50      5500
    1070    Beginnings      4       27500
    1071    Ride the Rapids 79      300
    1072    Funnel  24      4500
    1073    Dancing in the Light    15      4000
    1074    Storm on the Rise       55      8000
    1075    Western Boots and Spurs 6       6000
    1076    Ride the Bronco 79      1500
    1077    Bull Riding     6       5200
    1078    Chuckwagon      28      32000
    1079    Carrying the Mail       62      8000
    1080    The Dust Behind 59      18000
    1081    Coming Under Fire       13      650
    1082    Spring Flowers  29      20000
    1083    Untitled        64      2500
    1084    Crossing the Platt River        23      2200
    1085    Traces  63      20000
    1086    Untitled (solitude fixscape)     67      18000
    1087    Three Wosubject     81      20000
    1088    Lessons 37      3700
    1089    Existence Lessons    53      4125
    1090    Off the Grid    11      8000
    1091    Stone Palette   54      11500
    1092    Dressing Up     47      1300
    1093    Antelopes       62      12500
    1094    Existence Is Sweet   39      25000
    1095    The Spirit      61      20000
    1096    Ceremonial Sticks       10      15000
    1097    Untitled (Sea)  75      2800
    1098    Sweet Plan   56      592
    1099    Watch That Rattler      20      900
    1100    Hungry Cowboys  38      750
    1101    The Red Door    58      10000
    1102    Crying Hats     14      10000
    1103    Trail Object       1       8000
    1104    Untitled        70      1800
    1105    Meteor Show     80      10000
    1106    Horse Corral    40      12500
    1107    Striking It Rich        35      1750
    1108    Untitled Mural  77      400
    1109    Friends 22      16000
    1110    Three Sisters   62      6500
    1111    Untitled (subject and crucifix)     72      3200
    1112    Dark Canyon     27      8000
    1113    Shadow House    50      5500
    1114    Storytelling at the Campfire    50      18000
    1115    Starry Night    25      8500
    1116    Apache Warrior  30      23000
    

    —————————————————————————————————————————

    p1artist.txt

    1       Acconci
    2       Ames
    3       Aserty
    4       Baron
    5       Battenberg
    6       Bindner
    7       Blain
    8       Blum
    9       Budd
    10      Cardenas
    11      Carpenter
    12      Chico
    13      Colvin
    14      Cox
    15      Cridler
    16      Curtis
    17      Dawson
    18      DiGrigoro
    19      Dill
    20      Edwards
    21      Fleming
    22      Fratt
    23      Garber
    24      Garin
    25      Giama
    26      Gilhooly
    27      Gonzales
    28      Guys
    29      Hamend
    30      Higgins
    31      Hofmann
    32      Ibe
    33      Indiana
    34      Ingraham
    35      Irvin
    36      Kerrihard
    37      Kollasch
    38      Kritz
    39      Lerman
    40      Long
    41      Lowney
    42      Lundquist
    43      Lutes
    44      Maglich
    45      McGraw
    46      McIver
    47      Meglech
    48      Metz
    49      Miller
    50      Mogan
    51      Motherwell
    52      Novarre
    53      Odiezma
    54      Ortega
    55      Parker
    56      Penn
    57      Pierobon
    58      Prinzen
    59      Quiroz
    60      Rath
    

    —————————————————————————————————————————————

    p1artists-full.txt

    1       Acconci
    2       Ames
    3       Aserty
    4       Baron
    5       Battenberg
    6       Bindner
    7       Blain
    8       Blum
    9       Budd
    10      Cardenas
    11      Carpenter
    12      Chico
    13      Colvin
    14      Cox
    15      Cridler
    16      Curtis
    17      Dawson
    18      DiGrigoro
    19      Dill
    20      Edwards
    21      Fleming
    22      Fratt
    23      Garber
    24      Garin
    25      Giama
    26      Gilhooly
    27      Gonzales
    28      Guys
    29      Hamend
    30      Higgins
    31      Hofmann
    32      Ibe
    33      Indiana
    34      Ingraham
    35      Irvin
    36      Kerrihard
    37      Kollasch
    38      Kritz
    39      Lerman
    40      Long
    41      Lowney
    42      Lundquist
    43      Lutes
    44      Maglich
    45      McGraw
    46      McIver
    47      Meglech
    48      Metz
    49      Miller
    50      Mogan
    51      Motherwell
    52      Novarre
    53      Odiezma
    54      Ortega
    55      Parker
    56      Penn
    57      Pierobon
    58      Prinzen
    59      Quiroz
    60      Rath
    61      Reed
    62      Rissman
    63      Rogers
    64      Roman
    65      Schenck
    66      Scherzel
    67      Scholder
    68      Senior
    69      Shenal
    70      Statom
    71      Swartz
    72      Tidwell
    73      Turrell
    74      Udinotti
    75      Van Coller
    76      Waid
    77      Werner
    78      Wittner
    79      Wright
    80      Xie
    81      Yasami
    82      Zischke
    

    Expert Reply

     

    NOTE: Infered a lay-hold-on coercion AbjurationOutOfBound coercion detriment axioms in the input polish.

    Coercion Polish unravel , if you are started with Netbeans then you should fix your extract polishs in your plan folder,Coercion example: If your plan designate is ArtistFinder then your extract polishs should be in the folder radix plan folder designated ArtistFinder

    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.PrintWriter;
    import java.util.*;

    public dispose Professors
    {
    private String professorName;
    private int professorID;

    /** agent coercion Professor*/
    public Professors(int ID, String professors)
    {

    setArtistID(artistID = ID);
    setArtistName(artistDesignate = professors);
    }

    /** toString mode */
    public String toString()
    {
    return gainArtistID() + ” ” + gainArtistName();
    }

    /** gainter coercion professor designate*/
    private String gainArtistName()
    {
    return professorName;
    }

    /** setter coercion professor designate*/
    private nugatory setArtistName(String upstartName)
    {
    artistDesignate = upstartName;
    }

    /** gainter coercion professor ID*/
    private int gainArtistID()
    {
    return professorID;
    }

    /** setter coercion professor ID*/
    private nugatory setArtistID(int upstartID)
    {
    artistID = upstartID;
    }
    public static nugatory deep(String[] args)
    {
    ArrayList<Artists> myList = upstart AccoutreList<Artists>();
    int professorCounter = 0;
    String[] professorNameAccoutre = upstart String[116];
    try

    //Polish polish = upstart Polish(“plartists.txt”);
    //Scanner input = upstart Scanner(file);
    {
    Scanner input = upstart Scanner(upstart Polish(“p1artists.txt”));
    Polish Mypolish = upstart Polish(“p1artists_out.txt”);
    PrintWriter quenchedput = upstart StereotypeWriter(Myfile);
    int i = 0;
    while (input.hasNext())
    {
    artistCounter++;
    try
    {
    int professorID = input.nextInt();
    String professorDesignate = input.next();
    artistNameArray[i] = professorName;
    output.println(artistID + ” ” + professorName);
    i++;
    }
    lay-hold-on (InputMismatchQualification e)
    {
    input.next();
    }
    }
    output.close();
    input.close();
    }
    lay-hold-on (FileNotFoundQualification e)
    {
    System.out.println(“No such polish was found”);
    }

    /**Transcribe entire to upstart polish*/
    int j = 0;
    int artCounter = 0;
    int completionAppraised = 0;

    try
    {
    Scanner input = upstart Scanner(upstart Polish(“p1arts.txt”));
    Polish Polish = upstart Polish(“p1arts_out.txt”);
    PrintWriter quenchedput = upstart StereotypeWriter(File);
    while (input.hasNext())
    {
    try
    {
    String[] splinterAccoutre = input.nextLine().split(“t”);
    output.printf(“%st%st%st%st%sn”, splinterArray[0], splinterArray[1],
    splitArray[2], professorNameArray[j], splinterArray[3]);
    totalAppraised += Integer.parseInt(splitArray[3]);
    j++;
    artCounter++;
    }
    lay-hold-on (InputMismatchQualification e)
    {
    input.next();
    }
    lay-hold-on (IndexOutOfBoundsQualification e){

    }
    }
    output.close();
    input.close();
    }
    lay-hold-on (FileNotFoundQualification e)
    {
    System.out.println(“No such polish was found”);
    }

    /**Totals*/
    int finalArtistCount = professorCounter-1;
    System.out.println(“nCompletion professors: ” + finalArtistCount);
    System.out.println(“Completion sum of artwork: ” + artCounter);
    System.out.println(“Completion appraised esteem of entire artwork: $” + completionAppraised);
    }
    }