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 3 of 3

Thread: Need help with simple class and demo program

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help with simple class and demo program

    Ok, this is an assignment in my beginner java class. No I'm just posting so that I can get someone else to do my work for me. I've been working on this for about 15 hours in total and I can't get it. I've
    asked my instructor for assistance and she's been of no use what-so-ever.

    Here is the problem from the book:
    Write a class named UpperCaseFile. The class's constuctor should accept two file names as arguments. The first file should be opened for reading and the second file should be opened for writing. The
    class should read the contents of the first file, change all characters to uppercase, and store the results in the second file. The second file will be a copy of the first file, except all the characters will be uppercase. Use Notepad to create a simple file that can be used to test the class.

    My instructor gave us a design to help with the problem. This is her design:

    Create a class, where UpperCaseFile is the class name, whose attributes would be Scanner inputFile; PrintWriter outputFile; and whose methods would be
    public UpperCaseFile (String iFile, String oFile)throws IOException // constructor opens the files
    public void UpperFile()// reads input file, converts to upper case, and writes to output file
    public void CloseFiles()throws IOException//closes files
    Create an "InputFile.txt" in NotePad, with all lower case characters. "InputFile.txt" must be located in your Eclipse Workspace. To see the location of your Eclipse Workspace,
    File>Switch Workspace>Other, note the location, and then Cancel.
    Create a program to demonstrate the class, which uses each of the methods.

    I don't necessarily have to follow her design but I suppose that would be the most beneficial. Attached is a notepad file of the current code I've generated. Any help would be greatly appreciated!
    chapter 5.txt


  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,514
    My Mood
    Grumpy
    Thanks
    0
    Thanked 165 Times in 156 Posts

    Default Re: Need help with simple class and demo program

    Post your code here and use highlight tags. Do not link to it. Ask a specific question and get a specific answer. "I don't know what to do" is not specific.
    Improving the world one idiot at a time!

  3. #3
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: Need help with simple class and demo program

    And post SSCCE

Similar Threads

  1. [SOLVED] NoSuchElementException(), simple program not behaving right with Scanner class.
    By mwebb in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 25th, 2011, 06:41 PM
  2. please help with simple program!!!
    By jokneez in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 14th, 2011, 10:42 AM
  3. urgent simple help for a very simple program
    By albukhari87 in forum Java Applets
    Replies: 4
    Last Post: June 5th, 2010, 03:43 PM
  4. [SOLVED] Help with Class Methods(Probably simple)
    By ShakeyJakey in forum Object Oriented Programming
    Replies: 9
    Last Post: May 27th, 2010, 09:53 AM
  5. simple program
    By Memb in forum Paid Java Projects
    Replies: 0
    Last Post: March 17th, 2010, 01:47 PM