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

Thread: New to Java. Need help with homework

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default New to Java. Need help with homework

    I am having a hard time starting this project I am suppose to write a program that reads a text file and then takes the tokens from the text file and and in this case gives the user back a name a number grade and a letter grade. Please help im stuck

    ""You do not need to send me your input file. Your program should work with my input file named hw2.txt.

    Write a java program FirstnameLastnameHw2.java that reads student info from an external file with the following data, and displays the grades as displayed below.

    Input file hw2.txt (be aware of copy/paste issue). Add a record with your own name (and some numbers).



    Max Batman 73 83 93 20 20 20 18

    Jim Harper 76 88 68 15 20 20 20

    Joanna Karr 62 92 91 12 20 20 18

    Sue Hammond 75 88 78 20 0 20 20

    Mickie Foxx 65 77 91 12 0 0 20

    Sue Sirmons 98 52 94 20 20 20 0

    Jacqueline Savannah 98 87 99 0 20 20 20

    your name . . . .



    There are three test scores, out of 100 each, worth 60% and four homework scores, out of 20 each, worth 40% of grade.

    Apply 90%, 80%, 70% and 60% (standard) cutoff levels for letter grade computation.



    Example output (grades/averages are not accurate):



    Student Names Average Letter Grades

    --------------------------------------------

    Batman, Max 87 B

    Harper, Jim 73 C

    Karr, Joanna 78 C

    Hammond, Sue 82 B

    Foxx, Mickie 53 F

    Sirmons, Sue 93 A

    Savannah, Jacqueline 94 A

    Your name .. ..

    --------------------------------------------""


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: New to Java. Need help with homework

    Do you have any specific questions about your assignment?
    Please post your code and any questions about problems you are having.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: New to Java. Need help with homework

    well see i havent been able to write much yet. the "public static void" line is as far as ive got. I need some ideas of where to go from here

    --- Update ---

    My professor should us this the other day in class but im not sure how to use it
    import java.util.*;
    import java.io.*;

    public class FileReader
    { public static void main(String[] args) throws Exception
    { File file1 = new File("hw2.txt"); // finds file
    Scanner inFile = new Scanner(file1); // reads file
    // Scanner keyboard = new Scanner(System.in) allows for changes

    while (inFile.hasNext())
    { String line = inFile.nextLine();
    System.out.println(line);
    }
    }
    }

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: New to Java. Need help with homework

    where to go from here
    What's next?
    Make a list of the things the program needs to do. Check off the ones you have done so far, and start working on the next item in the list.

    Please edit your post and wrap your code with
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

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

    ptison (January 26th, 2013)

  6. #5
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: New to Java. Need help with homework

    Ok thank you. I know sombody that lives close by that is going to help me tommorrow

Similar Threads

  1. Really new to Java, need some help with some homework
    By vanillabilla in forum Java Theory & Questions
    Replies: 1
    Last Post: November 14th, 2012, 11:01 PM
  2. JAVA HOMEWORK HELP!
    By javafirsttime in forum What's Wrong With My Code?
    Replies: 6
    Last Post: November 14th, 2011, 07:00 PM
  3. New to Java Need help with Homework
    By cjg2283 in forum What's Wrong With My Code?
    Replies: 7
    Last Post: October 20th, 2011, 09:47 PM
  4. Help for java homework
    By Dark_Shadow in forum Object Oriented Programming
    Replies: 6
    Last Post: December 7th, 2009, 04:08 AM
  5. MORE java homework help.
    By TommyFiz in forum File I/O & Other I/O Streams
    Replies: 10
    Last Post: October 13th, 2009, 07:15 PM