Error message and refining program!

hI Im getting this error message
can anyone help on whats going wrong here?
any help appreciated
Paul
Enter the item part number: 10001
Enter the date of sales dd-Mmm-yyyy: 11-Apr-2003
Exception in thread "main" java.io.FileNotFoundException: 10001 (The system cann
ot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileReader.<init>(Unknown Source)
at week12.main(week12.java:27)
Here is the program and input files at bottom
import java.io.*;
import B102.*;
public class week12{
public static void main(String[] args) throws IOException{
int i;
int numrecords = 0;int index = 0;
int input_part = 0;
String line;
String str1, str2;
String stock;
String sales;
int partno[];
double price[];
String date[];
System.out.print("Enter the item part number: ");
stock = Keybd.in.readLine();
System.out.print("Enter the date of sales dd-Mmm-yyyy: ");
sales = Keybd.in.readLine();
System.out.print(" ");//This is only for spacing when printing to screen
BufferedReader infile1 = new BufferedReader(new FileReader(stock));
line = infile1.readLine();
numrecords = Integer.parseInt(line.trim());
price = new double[numrecords];
partno = new int[numrecords];
for(i = 0; i < numrecords; i++){
line = infile1.readLine();
index = line.indexOf(' ');
str1 = line.substring(0,index);//get part number
str2 = line.substring(index); //get price
partno[i] = Integer.parseInt(str1.trim());
price[i] = Double.parseDouble(str2.trim());
// close the file
try{
infile1.close();
//infile2.close();
}catch (IOException iox){
System.out.println("problem closing input file");
BufferedReader infile2 = new BufferedReader(new FileReader(sales));
line = infile2.readLine();
numrecords = Integer.parseInt(line.trim());
date = new String[numrecords];
for(i = 0; i < numrecords; i++){
line = infile2.readLine();
index = line.indexOf(' ');
str1 = line.substring(0,index);
str2 = line.substring(index);
date[i] = str2.trim();
// close the file
try{
//infile1.close();
infile2.close();
}catch (IOException iox){
System.out.println("problem closing input file");
PrintWriter outfile = new PrintWriter(new FileOutputStream("out.txt"));
//output contents of arrays
for(i=0;i<numrecords;i++){
outfile.println(partno[i]+" "+price);
System.out.println(partno[i]+" "+price[i]);
outfile.close();
//input file1 (stock)
10001 14.99 speakers
10021 5.99 mouse
10031 200.0 17"-Monitor
10041 215.0 Motherboard
10051 14.5 Keyboard
10061 1.1 mousepad
10071 199.99 desk
10081 15.49 floppydisk
10091 59.89 cdrom
10111 69.99 dvdrom
10221 479.99 dvdburner
10331 199.89 cpu
10441 180.0 harddisk
10551 139.0 gf4-440video
10661 59.99 pc2100-256m-ram
10762 213.44 printer
10871 6.99 printer-cable
10992 249.99 wireless-router-modem
//input file 2 (sales)
10-Apr-2003 10001 C00001 123 233.35
10-Apr-2003 10021 C00002 200 223.35
10-Apr-2003 10001 C00005 123 243.35
10-Apr-2003 10041 C00021 403 23.35
10-Apr-2003 10001 C00007 123 223.35
10-Apr-2003 10061 C00071 222 263.35
10-Apr-2003 10071 C00331 010 273.35
11-Apr-2003 10081 C00441 001 253.35
11-Apr-2003 10091 C00551 020 223.35
11-Apr-2003 10081 C00441 001 253.35
11-Apr-2003 10081 C00441 001 263.35
11-Apr-2003 10331 C03331 405 213.35
11-Apr-2003 10441 C04441 133 2333.35
11-Apr-2003 10081 C00441 001 252.35
11-Apr-2003 10661 C06661 155 253.35
12-Apr-2003 10762 C07771 166 263.35
12-Apr-2003 10871 C08881 177 293.35
12-Apr-2003 10992 C09991 175 203.35
12-Apr-2003 10762 C07775 165 269.99

It's saying that it can't find the file named "10001", which should be obvvious from the error message, in particular, this part: "java.io.FileNotFoundException: 10001 (The system cannot find the file specified)".
Considering that 10001 is apparently the item number, and your data file includes multiple items in a single file as so it's probable that an individual item number is not also the file name, it seems reasonable to expect that this exception would result from your program.

Similar Messages

  • I keep getting the itunes has stopped working error message and the program keeps closing itself everytime I atry to access the store

    Every time that I attempt to open the store in my iTunes program, I receive and error message and it states ITunes has stopped working and needs to close the program. How do I fix this?

    Restart your computer then try iTunes.

  • So I download photoshop cc (2014) and when I go to open the program, it gives me an error message and shuts the program down. It says," A problem cause the program to stop working correctly. Windows will close the program." Can someone help me please?

    So I download photoshop cc (2014) and when I go to open the program, it gives me an error message and shuts the program down. It says," A problem cause the program to stop working correctly. Windows will close the program." Can someone help me please?

    I've got the same issue and it affects all my adobe software.  You are not alone as I have seen several postings looking for the answer to this help request.

  • All of a sudden my iTunes stopped working, and I get the following error messages:   1. the program can't start because MSVCR80.dll is missing from your computer. Try reinstalling the program to fix this problem   and   2. iTunes was not installed correct

    All of a sudden my iTunes stopped working, and I get the following error messages:
    1. the program can't start because MSVCR80.dll is missing from your computer. Try reinstalling the program to fix this problem
    and
    2. iTunes was not installed correctly. Please reinstall iTunes. Error 7 (Windows error 126).
    Now I've checked the forums and followed the advice of uninstalling all Apple applications, rebooting, and reinstalling iTunes.
    This is not working. I've tried installing as Administrator but doesn't make any difference at all.
    There must be a way to fix this? I'm not a tech geek but I want to avoid having to take my laptop back to factory settings to sort this out.
    Thanks

    Click here and follow the instructions. You may need to completely remove and reinstall iTunes and all related components, or run the process multiple times; this won't normally affect its library, but that should be backed up anyway.
    (99192)

  • I am trying to load iTunes and keep getting a error 126 and reinstall program.  I have uninstalled and reinstalled twice and keep getting the same error message.  How can this be resolved.

    I am trying to load iTunes and keep getting a error 126 and reinstall program.  I have uninstalled and reinstalled twice and keep getting the same error message.  How can this be resolved?

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    tt2

  • A way to display error messages from the program

    Dear all,
    I am looking forward to display a set of error messages(in a internal table) during the execution of the program to the user.
    I wanted to know the better way of displaying error messages from my program with more options.
    Well I tried out using displaying errors as ALV list/Grid or as simple list processing.
    But I found some  stanadard transactions (Like in MM and FI  where errors are shown in a better way, but failed to find out how they are done.
    Please guide me.
    Thanks in advance
    Aryan

    Try to use application logging it has a very good way to display a set of messages.
    [http://abap4.tripod.com/Using_Application_Logging.html|http://abap4.tripod.com/Using_Application_Logging.html]
    Run this report in se38 an example sap report to understand logging way to show a set of messages
    Report Name  :  SBAL_DEMO_01
    Edited by: Vighneswaran CE on Dec 19, 2010 3:01 PM
    Edited by: Vighneswaran CE on Dec 19, 2010 3:11 PM

  • I loaded the new version of Mozilla, now I get microsoft defender error messages and then i can no longer connect but explorer still connects. How do I fix it?

    i loaded the newest version of Mozilla, i have windows vista. I began receiving microsoft defender error messages and now i can only connect the internet through explorer. i love using mozilla. what can i do to fix the problem?

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features(Later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (If this won't uninstall press on)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    See also HT1925: Removing and Reinstalling iTunes for Windows XP or HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    Should you get the error iTunes.exe - Entry Point Not Found after the above reinstall then copy QTMovieWin.dll from:
    C:\Program Files (x86)\Common Files\Apple\Apple Application Support
    and paste into:
    C:\Program Files (x86)\iTunes
    The above paths would be for a 64-bit machine. Hopefully the same fix with the " (x86)" omitted would work on 32-bit systems with the same error.
    tt2

  • HT1926 I was loading an update to my i-Tunes for my computer and got an error message and now I can not open my computer itunes and may have lost all the content. What do I do?

    I got a request from apple to update my itunes and while uploading the update, the program gave an error message and now I can not open my itunes and fear that all my music etc is gone?  what do I do to correct this problem?

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    tt2

  • Does anybody know if you uninstall iTunes (mine is giving me an error message) and then re-install, will my music still be there (somewhere?)  I don't have it saved to the cloud, but it is on my iPad.

    Does anybody know if you uninstall iTunes (mine is giving me an error message) and then re-install, will my music still be there (somewhere?)  I don't have it saved to the cloud, but it is on my iPad  I recently upgraded my iTunes account and now I can't open it.  I get an error message and it says I need to re-install.

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    tt2

  • Error messages in ABAP program are stored in which table

    hi all,
    Can anyone tell
    error messages in ABAP program are stored in which table??

    Hi Sir ,
    Please have a look below .Hope it is suitable and simpler solution for your question.
    Please do reward if useful.
    Thankx.
    Fuction module for storing error messages  ->'format_message'
    for example...
    data : v_message(100) type c.
    call transaction NNNN mode A update S messages into it_messages.
    loop at it_messages where msgty = 'E'.
    call function 'format_message'
    exporting
    *it_messages details
    importing
    v_message.
    write :/ v_message.
    clear v_message.
    endloop.
    Anothe method - ->
    Here is a sample of the program code for that:
    LOOP AT it_messtab.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    id = it_messtab-msgid
    lang = it_messtab-msgspra
    no = it_messtab-msgnr
    v1 = it_messtab-msgv1
    v2 = it_messtab-msgv2
    IMPORTING
    msg = g_msg
    EXCEPTIONS
    OTHERS = 0.
    IF it_messtab-msgtyp = 'S'.
    it_sucess-sucess_rec = g_msg.
    it_sucess-lifnr = it_header-lifnr." Based on your field
    it_sucess-tabix = v_lines.
    APPEND it_sucess.
    ELSEIF it_messtab-msgtyp = 'E'.
    it_error-error_rec = g_msg.
    it_error-lifnr = it_header-lifnr.
    it_error-tabix = v_lines.
    APPEND it_error.
    ELSE.
    it_info-info_rec = g_msg.
    it_info-lifnr = it_header-lifnr.
    it_info-tabix = v_lines.
    APPEND it_info.
    ENDIF.
    ENDLOOP.

  • Transferred Elements 8 to new power mac and get 150:30 error message and told licensing has stopped.

    How can I get Adobe Elements 8 activated on my new Power Mac?  Program has been transferred but I'm getting a 150:30 error message and told that my licensing has expired.

    If you don't really mean a power mac, but rather a new mac, you can never transfer an installed copy of PSE. The first thing to try is running the uninstaller and then installing from scratch. That may very well not work, though, in which case you have a lot more work to do.

  • Why does not connect properly macpro my motorola bluetooth headphones S10? I get a connection error message and there is no sound. (I want to use headphones to listen to music via bluetooth from my macpro)

    Why does not connect properly macpro my motorola bluetooth headphones S10?     I get a connection error message and there is no sound.                         (I want to use headphones to listen to music via bluetooth from my macpro)   
    the s10 works perfectly on my ipod touch 4g. 

    this is   
    ERROR HAS OCCURRED Bluetooth audio.
    It failed to establish connection with their
    audio device. make sure it is on and
    in the range. you may need to restart the
      audio section of the program you were using
    STOP USING THE HEADSET WITH MICROPHONE.
    ALSO HAVE A MOTOROLA BLUETOOTH SPEAKERS WHICH EQ5 work seamlessly with the Mac

  • I have just bought an iPhone 5 and it won't sync to iTunes.  It says it needs  iTunes 10.7, which I have downloaded and installed.  I still get the error message and looking at "about iTunes" it says 10.6.3.  What do I do??

    I have just bought an iPhone 5 and it won't sync to iTunes.  It says it needs  iTunes 10.7, which I have downloaded and installed.  I still get the error message and looking at "about iTunes" it says 10.6.3.  What do I do??

    Perhaps check to see if you're accidentally running two different versions of iTunes. There's some information on troubleshooting that in the Opening iTunes section of the following document:
    Troubleshooting iTunes installation on Mac OS X

  • ITunes will not open (no error message and not running Norton 2005)

    I have recently upgraded to iTunes 7 and I now cannot get it to open after clicking on the icon. The iTunes.exe process comes up in the task manager briefly then disappears. There is NO accompanying error message and I am NOT running Norton Antivirus 2005. I have already tried reinstalling the standalone version of quicktime and I have used msconfig so that I essentially have only the necessary iTunes/quicktime processes running (no antivirus/antispyware/anti-popup software is running in the background). I have Windows 2000 and I have never had a problem with iTunes until now. Somebody please help me out here.

    wapierce,
    It looks like we have covered all the bases here. Unfortunatly it looks like The computer cannot run iTunes or the OS has an issue that may require a reeinstall.
    Lets verify the Hardware and OS one more time. Click Start> right click My Computer> Properties(you can also open My Computer then click view system information on the left side of the window.) What does the processor and Memory say here? Also what is it saying aout Windows.
    Make sure there are no upadtes available for the computer.
    When you installed iTunes did you make any registry changes? It sounds like the next step would be doing a restore or re-install of Windows on the computer.
    Jason

  • HT204088 The directions you provided above doesnt even work!  when I selected "Click to open your account", there is an ERROR message and takes me to no where!  when I try to access my itunes account, it says I have no history?

    The directions you provided above doesnt even work!  when I selected "Click to open your account", there is an ERROR message and takes me to no where!  when I try to access my itunes account, it says I have no history?

    You are not able to view purchase history on your iOS device.  You may only re-download previous purchases from the iOS device.
    To review your iTunes Store account's purchase history, follow the steps in this article from a computer only:
    Seeing your iTunes Store purchase history and order numbers
    http://support.apple.com/kb/HT2727

Maybe you are looking for