Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Help with Java Programming Assignment Please?

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Help with Java Programming Assignment Please?

    I have a java assignment due for college (I'm doing 2nd year multimedia programming) in a few weeks and I’m really struggling and don’t have a clue what to do.

    The following is the first part of the assignment. I have to implement a Java application that demonstrates the use of file input/output and exception handling. my application should allow the user to enter data about some entity that is stored in a data file. My application should be able to read data from a data file, and to store that data in a set of objects.

    The following is what I have already. A lot of it is probably wrong, and I don't know what to do next.


    BookTest.java
    package books;
     
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.PrintWriter;
    import java.util.Scanner;
     
    public class BookTest {
     
        public static void main(String[] args) 
                throws FileNotFoundException
        {  
     
            File f = new File (input.txt);
     
            if ();
            {
                FileReader = new FileReader();
            }
     
           /* BufferedReader = new BufferedReader();
            PrintWriter pw = new PrintWriter(File);*/
     
            //Prompts the user for the input and output file names
           /* Scanner console = new Scanner(System.in);
            System.out.print("Input file: ");
            String inputFileName = console.next();
            System.out.print("Output file: ");
            String outputFileName = console.next();
     
            //Prompts the Scanner and PrintWriter objects for reading and writing
            File inputFile = new File(inputFileName);
            Scanner in = new Scanner(inputFile);      
            PrintWriter out = new PrintWriter(outputFileName);
            int lineNumber = 1;
            */
     
     
     
            /*  while (in.hasNextLine());
            {
                String line = in.nextLine();
                out.println("/* " + lineNumber + " * " + line);
            }
            in.close();
            out.close();   */
     
        }
    }
    Books.java
    package books;
     
    public class Books {
     
        private String title;
        private String authorFName;
        private String authorLName;
        private double price;    
    }

    I would really appreciate it if anyone could help me please. Thank you.
    Last edited by a21j92; December 26th, 2012 at 01:46 PM. Reason: please use [code] tags


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Help with Java Programming Assignment Please?

    Please post the code you have here on the forum and ask questions about the problems you are having.
    Don't expect us to follow links to the assignment or your code.
    If you don't understand my answer, don't ignore it, ask a question.

  3. The Following User Says Thank You to Norm For This Useful Post:

    a21j92 (December 26th, 2012)

Similar Threads

  1. java programming assignment help
    By darking123 in forum What's Wrong With My Code?
    Replies: 56
    Last Post: October 4th, 2012, 06:05 PM
  2. java programming assignment help
    By darking123 in forum Java Theory & Questions
    Replies: 0
    Last Post: October 1st, 2012, 07:26 AM
  3. Help on programming assignment
    By aaronmcohen in forum AWT / Java Swing
    Replies: 0
    Last Post: March 7th, 2012, 07:47 PM
  4. Programming help with java assignment!
    By kami21 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: June 15th, 2011, 06:37 PM
  5. programming assignment help
    By sdgseed in forum Threads
    Replies: 1
    Last Post: October 20th, 2010, 02:43 PM

Tags for this Thread