Help!!!asap..about multiple files...

I already have a working class for this part.All I need is the application part that will create a property object for each data line read from the the input file assign4.dat. This application should also print each object to a data file, according to its category. If category 1, properties should be printed out to out1.dat, category2 to out2.dat, category 3 to out3.dat, and the rest to outRest.dat..Please help me start off my program.. I am a new programmer trying to learn new things..I would appreciate all your help..here is my working class, that works perfectly fine..and also the assign4.dat, for ur better understanding..Tnx..
import java.util.StringTokenizer;
import java.io.*;
public class Property{
private int category;
private double sellingPrice;
private double commissionRate;
private double commission;
public void Property(String s){
StringTokenizer tokenizer=new StringTokenizer(s);
category=Integer.parseInt(tokenizer.nextToken());
sellingPrice=Double.parseDouble(tokenizer.nextToken());
public void Property(int cat, double selP){
cat=category;
selP=sellingPrice;
public void setCommissionRate(){
if(category==1)
commissionRate=0.04;
if(category==2)
commissionRate=0.06;
if(category==3)
commissionRate=0.071;
public void setCommissionRate(int i){
if((i>=1)&&(i<=3))
category=i;
this.setCommissionRate(i);
else
commissionRate=i;
public double getCommission(){
commission=sellingPrice+commissionRate;
return commission;
public double getCategory(){
return category;
public String toString(){
return "Price: "+sellingPrice+ " Category: "+category+ " Commission Rate: "+ commissionRate + " Commission: "+ commission;
}//end of property
//start of assign4.dat
1 457000
3 14550
2 49000
1 189000
2 24340
3 156700
3 78900
1 39000
1 345500
1 789000
2 550000
1 23500
4 78000
1 45000
5 899999

look at this
[url http://forum.java.sun.com/thread.jspa?threadID=686112]multiple post

Similar Messages

  • Need help asap about point and shoot for inside

    trying to take pictures for auction listings, don'thave a lot of experience.  have been told about canon powershot and panasonic lumix - could you tell me what will be the easiest for me to use and give me the best inside pictures of objects to list - thanks!!!!

    The key to getting a good picture is to make sure that you can control the light and less about the exact camera as long as you do not purchase any junk.
    For auction images, you should invest in a small light box setup with multiple strobes/flashes that illuminte the item properly.  In order to do this, then you should get an inexpensive SLR.  You should also get a small tripod and remote shutter release that will allow you to make correctly focus pictures.
    Currently, Nikon and Canon are head to head when it comes to image quality with Nikon edging out Canon since they have recently introduced some really great lenses.  Sony is doing OK, but remember Canon and Nikon own 90 % of the camera market and the other 10% is left to everyone else.  Sony is having some problems with ISO images that contain a lot more noise than Canon or Nikon.
    Check out www.dpreview.com and www.luminous-landscape.com for reviews by photographers.
    I do not work for Best Buy and am not affiliated with them in any way. I like HT and want to help people improve their HT experience. "There is a LOT more than just having a TV to make a home theater"

  • Need help fast about opening file

    hello i have this 2 classes to open file and display it .the open method works fine but when ever i try to open different file it adds the new data and display both . the problem is it not suppose to add the new data to the old list it should only show the new data only ...can any one help thx
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class RoomGUI extends JFrame
       private RoomSortedList list;
         // Menu items:
       private JMenuItem mOpen;
       private JMenuItem mSaveAs;
       private JMenuItem mExit;
         // Displayed regions of the window:
         private JTextField messageField;
         private JTextArea textArea;
          * Constructor for RoomGUI object to set up
          * GUI window with menu.
         public RoomGUI()
              list=new RoomSortedList();     
         // Components to display on window:
              messageField = new JTextField();
              messageField.setEditable(false);
              textArea = new JTextArea();
              textArea.setEditable(false); 
                        // Arrnge components on window:
              Container contentPane = getContentPane();
              contentPane.add(messageField, BorderLayout.SOUTH);
              JPanel centerPanel = new JPanel();
              contentPane.add(centerPanel, BorderLayout.CENTER);
              centerPanel.setLayout(new GridLayout(1,1));
              centerPanel.add(new JScrollPane(textArea));
    //  Create menu items for the "File" menu:
          mOpen = new JMenuItem ("Open");
          mSaveAs = new JMenuItem ("SaveAs");
          mExit = new JMenuItem ("Exit");
          //  Create "File" menu:
          JMenu fileMenu = new JMenu ("File", /*tearoff =*/ false);
          fileMenu.add(mOpen);
          fileMenu.add(mSaveAs);
          fileMenu.add(mExit);
          // Create menu bar:
          JMenuBar mainMenuBar = new JMenuBar();
          mainMenuBar.add(fileMenu);
          // Put menu bar on this window:
          setJMenuBar(mainMenuBar);
         mOpen.addActionListener( new FileOpener(textArea,list) );
         mSaveAs.addActionListener( new FileSaver(list) );
          mExit.addActionListener(new Quitter());
              // Routine necessities with JFrame windows:
              setSize(500, 400);
              setLocation(200, 100);
              setTitle("Project 4");
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              setVisible(true);
         } // constructorfile opener
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class FileOpener implements ActionListener
         private RoomSortedList list;
         private JTextArea textArea=new JTextArea();
              private int returnvalue;
              private String filename;
              private JTextField messageField;
         public FileOpener(JTextArea ta,RoomSortedList ls)
              this.textArea=ta;
              this.list=ls;
         public void actionPerformed(ActionEvent e)
              list =new RoomSortedList();
              messageField = new JTextField();
              JFileChooser filechooser = new JFileChooser();
             // if a file is selected returnvalue = 0
             // else if cancel button is pressed
             // returnvalue = 1
             returnvalue = filechooser.showOpenDialog(null);
             //if open is selected then return filename
             if (returnvalue == filechooser.APPROVE_OPTION){
                filename = filechooser.getSelectedFile().toString();
                // now read the rooms from the file with the name filename
                // invoke the readfile method
                readFile(filename);
                messageField.setText(filename);
             }//if
             // if cancel is selected then close the filechooser
             else if (returnvalue == filechooser.CANCEL_OPTION)
                filechooser.cancelSelection();
       * Reads room data from a text file.Check if each lines are in valid room
       * format, and values. Catches exception errors for any invalid lines or
       * values thrown by ParseRoom or Room constructors.
       * Valid lines are appended to an sorted linked list. 
       * @param filename     name of file containing
       private void readFile(String filename)
           JFrame errorD=new JFrame();
          String str=null;
          Room r=null;
          int linenum=0;
          TextFileInput Obj=null;
          try
             Obj = new TextFileInput(filename);
          catch (RuntimeException rte)
             System.out.println(rte.getMessage());
          while (true)
             str = Obj.readLine();
             linenum++;
             if (str==null) break; // to stop reading lines at the end of file
             try
                r = RoomTextFormat.parseRoom(str);
             catch (RoomTextFormatException rtf)
                JOptionPane.showMessageDialog(errorD, "Error reading line # " +
                   linenum + ": " + str + "\n" + rtf.getMessage() + "\n"+
                   "This line of text has been excluded from the list.",
                   "Text Format Error", JOptionPane.ERROR_MESSAGE);
                continue;
             catch (IllegalRoomException ire)
                JOptionPane.showMessageDialog(errorD, "Error reading line # " +
                   linenum + ": " + str + "\n" + ire.getMessage() + "\n" +
                   "This line of text has been excluded from the list.",
                   "Room Instantiation Error", JOptionPane.ERROR_MESSAGE);
                continue;
             list.insert (r);
             textArea.setText("");
                RoomListIterator MyIterator = list.beginIterating();
                int c=1;
                while (MyIterator.hasNext())
                   Room m = MyIterator.next();
                   textArea.append(c + ": " + m + "\n");
                   c++;
                }//while
          }// while (true)
       } // readFile()
    }

    i apologize again.thx anyway . heres the code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class RoomGUI extends JFrame
         private RoomSortedList list;
         // Menu items:
         private JMenuItem mOpen;\
         // Displayed regions of the window:
         private JTextField messageField;
         private JTextArea textArea;
          * Constructor for RoomGUI object to set up
          * GUI window with menu.
         public RoomGUI()
              list=new RoomSortedList();     
              // Components to display on window:
              messageField = new JTextField();
              messageField.setEditable(false);
              textArea = new JTextArea();
              textArea.setEditable(false); 
              // Arrnge components on window:
              Container contentPane = getContentPane();
              contentPane.add(messageField, BorderLayout.SOUTH);
              JPanel centerPanel = new JPanel();
              contentPane.add(centerPanel, BorderLayout.CENTER);
              centerPanel.setLayout(new GridLayout(1,1));
              centerPanel.add(new JScrollPane(textArea));
                  //Create menu items for the "File" menu:
              mOpen = new JMenuItem ("Open");
              //  Create "File" menu:
              JMenu fileMenu = new JMenu ("File", /*tearoff =*/ false);
              fileMenu.add(mOpen);
              // Create menu bar:
              JMenuBar mainMenuBar = new JMenuBar();
              mainMenuBar.add(fileMenu);
              // Put menu bar on this window:
              setJMenuBar(mainMenuBar);
              mOpen.addActionListener( new FileOpener(textArea,list) );
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              setVisible(true);
         } // constructor
    } // class RoomGUIopen file
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class FileOpener implements ActionListener
         private RoomSortedList list;
         private JTextArea textArea=new JTextArea();
              private int returnvalue;
              private String filename;
              private JTextField messageField;
         public FileOpener(JTextArea ta,RoomSortedList ls)
              this.textArea=ta;
              this.list=ls;
         public void actionPerformed(ActionEvent e)
              list =new RoomSortedList();
              messageField = new JTextField();
              JFileChooser filechooser = new JFileChooser();
             // if a file is selected returnvalue = 0
             // else if cancel button is pressed
             // returnvalue = 1
             returnvalue = filechooser.showOpenDialog(null);
             //if open is selected then return filename
             if (returnvalue == filechooser.APPROVE_OPTION){
                filename = filechooser.getSelectedFile().toString();
                readFile(filename);
                messageField.setText(filename);
             }//if
             // if cancel is selected then close the filechooser
             else if (returnvalue == filechooser.CANCEL_OPTION)
                filechooser.cancelSelection();
       private void readFile(String filename)
          String str=null;
          TextFileInput Obj=null;
             Obj = new TextFileInput(filename);
          while (true)
             str = Obj.readLine(); // 
             if (str==null) break; // to stop reading lines at the end of file
             list.insert (str);
             textArea.setText("");
                RoomListIterator MyIterator = list.beginIterating();
                int c=1;
                while (MyIterator.hasNext())
                   Room m = MyIterator.next();
                   textArea.append(c + ": " + m + "\n");
                   c++;
                }//while
          }// while (true)
       } // readFile()
    }

  • Basic help required for multiple files to be opened from Bridge to PS

    Hi
    I am attempting to shave off a few hours from my workflow and because I'm new to Bridge I'm unsure how to do this. I'm pretty sure anyone out there with a small working knowledge of Bridge or CS3 could help me.
    I am attempting to open three instances of the same RAW file into CS3 from Bridge. The three instances, although the same image, need to go through CameraRaw and change the exposure. One normally exposed, one +2 exposure and one -2 exposure. As you may have worked out I am attempting a pseudo-hdr effect with the one RAW file.
    How do I, with just one click, open the file three times, change the exposure each time, and then save the differently exposed files as tiffs?
    If it's ImageProcessor that I need to use then I'll admit I can't quite work out the rules for doing this!
    Any help gratefully received.

    Have a look at this thread.....
    http://forums.adobe.com/thread/623234?tstart=30

  • Help to export multiple files

    Hey! I hope i can explain well in english
    My problem are I need to convert all my mp4 files in my timeline to dnxh120 or 185 but i dont want all files convert to ONE file..
    I know AVID have transcode so each moviefile can convert so i can export to AAF and i want all filename is same but not .mp4 and i want instead .mov with dnxhd120 codec so i can export to other company while using avid easier.
    I think its must have a easier thing than i must convert EACH file and retype EACH same name as before..  Hope someone understand what i mean?
    I am using premiere pro 5.5.

    See if setting up a watch folder for the Adobe Media Encoder does what you want:
    Media Encoder Help | Add and manage items in the encoding queue
    Read the section titled, "Add a watch folder to the encoding queue"
    Jeff

  • Java Web Start help needed about writing files?

    Hi there! I have this java web start app. i have implemented the File Open service succesfully using the JNLP API but i cant seem to get the File Save Service to work. Basically I have an object in the system which I want it to be serialised to a file on the user's desktop.
           FileSaveService fss;
             try {
                 fss = (FileSaveService)ServiceManager.lookup
                                       ("javax.jnlp.FileSaveService");
             } catch (UnavailableServiceException e) {
                fss = null;
            if (fss != null) {
                try {
                FileContents fc = null;
                FileContents newfc = fss.saveFileDialog(null, null,
                fc.getInputStream(), "newFileName.txt");
                FileIO io = new FileIO();
                io.write("new123.nod", r.getTree());  /// my object is r.getTree() !!!
                } catch (Exception e) {
                      e.printStackTrace();
            }My Object (r.getTree) is basically an array. But I cant save it because the saveFileDialog method accepts ObjectInputStream as a parameter?! Any ideas? Thanks!
    Edited by: player123 on Jun 11, 2009 8:56 AM

    does anyone know? It actually doesnt even open the Save dialog?? why is that?

  • Help needed about deleting files.

    Anyone could tell me what Java sentence can I use to delete a file from a UNIX filesystem. What class does provide this method?

    Hi,
    The File class has got method to delete a file from file system.
    File objFile = new File("<the complete path of the file>");
    if(objFile.exists()) { objFile.delete(); }
    Only extra thing with unix will be permission to delete
    the file. If the user who is logged into the system with
    permission to delete the file then only the java
    program which is run under that user id will be able
    to delete the file. Otherwise change the mode of that
    directory to '777'.
    chmod 777 /home/temp

  • Itunes wont open/ file icon on ipod- NEED HELP ASAP!

    My itunes will not open at all on my comp. I downloaded the newest version, then nothing would open. I removed all versions and attempted to re-install again. Now, my ipod will not turn on. There is a file icon with an exclamation point. I dont know waht to do and I am leaving for a long trip in a few days and need my ipod! any help asap would be greatly appreciated!
    dell   Windows XP  

    OK-
    First, let's get your iTunes open.
    Click on Start, Click on Run
    Type msconfig
    Click on the startup tab (last one on the right)
    Click on "disable all"
    Click apply, then click close
    Go ahead and restart your computer when prompted to do so
    When your computer starts back up, you should be able to open up your iTunes. When it opens, close it again. Now that we know it is able to open, it needs to be closed in order to resolve the file folder with exclamation point error.
    Now, let's get that file folder issue resolved.
    Click start, click all programs, click iPod, click iPod updater, click iPod updater (again)
    Click OK when you see the dialogue that tells you what the application's capabilities are
    Connect your iPod when it tells you to
    Click on the "restore" button when it becomes available
    IF the restore button does not become available, and if the iPod updater fails to recognize the iPod, disconnect it. Reset the iPod by (making sure the hold switch is off) pressing the menu button and the select button at the same time for about 10 seconds, until you get the Apple logo. As soon as you get the Apple logo, hold down the select button and the play/pause button together until you get a check mark on the screen. You may have to try this several times to get it to work... and sometimes it helps to lay the iPod down on a hard flat surface, like a table or your computer desk.
    Once you get the iPod into disk mode, you can go ahead and try to restore it again. (Start > All Programs > iPod > iPod Updater > iPod Udpater) Click OK, Connect your iPod when it asks you to do so, and then click the restore button when it becomes available.
    If you're still having issues, try reading through some of the following articles:
    http://docs.info.apple.com/article.html?artnum=93736
    http://docs.info.apple.com/article.html?artnum=61003
    Keep us posted
    CG

  • User with a paid CC acct, getting "Print.ai" is an unknown format' when trying to open new file. Computer was recently attacked by ransomeware and wonder if I need to re-install Creative cloud software....need help asap!!

    User with a paid CC acct, getting "Print.ai" is an unknown format' when trying to open new file. Computer was recently attacked by ransomeware and wonder if I need to re-install Creative cloud software....need help asap!!

    First, ask in the forum for the program you are using
    This forum is about the Cloud as a delivery process, not about using individual programs
    If you start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll
    Second, do a complete scan with a good anti-virus program to be sure your computer is clean... I use Norton, there are others

  • Windows has the following information about this file type. This page will help you find software needed to open your file. Cannot get SEO quale loaded please help

    I cannot download as I keep getting this when I try
    Windows has the following information about this file type. This page will help you find software needed to open your file.
    File Type: Firefox Browser Extension
    File Extension: .xpi
    Description: Compressed archive of primary file installation components – used by the Mozilla installer script to setup and install various applications. You may search the following Web site for related software and information:
    Please advise how I go about downloading

    despite the workaround, it doesn't fix the real problem. It shouldn't be a huge deal for adobe to add support for multiple svn versions. Dreamweaver is the first tool i've used that works with svn that doesn't support several types of svn meta data. If they're going to claim that Dreamweaver supports svn is should actually support svn, the current version, not a version several years old. This should have been among the first patches released, or at least after snow leopard came out (and packaged with it the current version of svn).
    does anyone know if the code that handles meta data formatting is something that is human readable, or where it might be, or is it in compiled code.
    i signed up for the forums, for the sole purpose of being able to vent about this very frustrating and disappointing situation.

  • Need Help ASAP  my State tax form is in a PDF file and the attachment in my email says Please wait

    Need Help ASAP  my State tax form is in a PDF file and the attachment in my email says Please wait...
    I tried downloading updates like it said to but it still will not display the document.  How do I print the PDF file ASAP

    Can you give us a LOT more info?
    What email client? What version of Reader (I can only assume you even have Reader at this point)?
    Please wait? I'm sure it says more than that, right?
    Have you tried simply saving the PDF (it IS a PDF correct?) to your desktop and opening it from there?
    Did you get this form from the IRS or did it come from somewhere else? If the IRS again, what version of Reader?
    Help us help you.

  • PhotoShop Elements 10...I need help with font size for watermark in Processing Multiple Files.....

    I have PhotoShop Elements 10, and I am trying to watermark some of my photos, I have successfully added them one at a time with a font large enough to be seen. Now I am trying to add it using the "process multiple files" , I can do that but the font even at 72 the largest setting is so small on the photo you can barely read it! Can anyone help me the size larger on my photos?

    Thank you, Michael. I just watched the Russell Brown video again for CS6 and looked real closely at his settings in ACR and he was using 240ppi. I changed my file in image size to 240 ppi and then ran the script and the layer didn't change size this time when I ran the script.
    It is kind of annoying to have to change the image size everytime I want to run this script and then change it back again as most of my files are 300 ppi. I used to run his script for edit in ARC in CS5 and recall that if I just remembered to change the settings in ARC to 300 ppi while the script was playing and before pressing 'open' that the image wouldn't change size during the raw processing, but this doesn't seem to be working in CS6. Do you know of a way to use this script and not have to change the ppi for the image to 240?
    Thanks again.

  • Hi, Im new to Apple MacBook PRO. I have saved about 50GB files plus applications and message advises that my start up disk is almost full! My MacBook pro has a 500GB hard drive so don't know why this message is coming up. Please help.

    Hi, Im new to Apple MacBook PRO. I have saved about 50GB files plus applications and message advises that my start up disk is almost full! My MacBook pro has a 500GB hard drive so don't know why this message is coming up. Please help.

    MacBook Pro
    https://discussions.apple.com/community/notebooks/macbook_pro 
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.7_lion?view=discussi ons

  • Help me please about export file is .wmv

    help me please about export file is .wmv from final cut pro
    It have black side at right and left in clip when export finished
    I have flip4mac program in my mac
    How do I edit.

    Let me help getting your question back to something we might understand.
    - You are exporting your video AS .wmv
    and
    - when you export it, there are black bars left and right of the image.
    How do you fix?
    Ok - what was the format of the video prior to your exporting it? When you edited it in FCP, what were the sequence settings? That will help get the right settings for flip4mac.
    CaptM

  • HOW TO - Create new from clipboard and process multiple files - please help

    Need help - have new version of photoshop on trial only ATM...
    Want to know - HOW TO:
    1. Create new from clipbaord
    2. Process multiple files
    Please help.

    For clipboard copy, I start with File > New and the size will be set to what's in the clipboard. Then once the new file is opened, Edit > Paste will place the clipboard contents as a layer in the new document.
    You must remember to use the command Layer > Flatten Image of you want to save as jpeg or any other file format that doesn't support layers.
    For processing multiple files,
    File > Automate > Batch or
    File > Scripts > Image Processor...
    Check the User guide or google information for those commands if you have specific needs.
    Gene

Maybe you are looking for

  • Sync failure

    When I try to sync my iPod I always get the following message. "Attempting to copy to the disk "John" failed. The disk could not be read from or written to." I restored my iPod to original factory settings and tried to sync again and after two albums

  • CS4 Premiere locking up royally on little mts files on Mac Pro Lion 10.7, is CS5.5 any better

    Sorry for long title, got the boxes mixed up. Having trouble working with HDV mts files in CS4 Premiere on a new 12 core MAC Pro with Lion 10.7 OS Have used Adode CS3 and now CS6 at my office regularly. CS6 can work with about any file type. Found th

  • Top-Level Navigation content problem

    I have a bsp iview. I had inserted this iview in the first position of a role. This role has more iviews. The role hava entry point. When I click in the top-level navigation (role), it launchs the iview but i can't see the content of the role in the

  • Problem serializing and unSerializing.

    Hello, I am experiencing some problems with a client/server application I am writing. After I open a Socket the server application has to send to the client a comment and an object in certain time intervals. Here is the code on the server side:     c

  • I did not get a CD with my refeberished airport express

    do I need the CD for airport express or can i download it, it did not come with my order