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: Can someone please help me get a start on this project?

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

    Default Can someone please help me get a start on this project?

    The instructions are this:
    Write a program in Java and run it in BlueJ according to the following specifications:
    The program reads a text file with student records (first name, last name and grade) and prints them in the terminal window.
    After the name and grade it also prints the type of the grade: excellent (> 89), ok [60,89], and failure (< 60).
    Then the program prints the number of students, and their average grade and also the number of students and their average in each grade category (excellent, ok, and failure).
    For example, with the input file http://www.cs.ccsu.edu/~markov/ccsu_...1/students.txt the program must print the following:

    John Smith 90 excellent
    Barack Obama 95 excellent
    Al Clark 80 ok
    Sue Taylor 55 failure
    Ann Miller 75 ok
    George Bush 58 failure
    John Miller 65 ok
    There are 7 students with average grade 74.0
    There are 2 excellent students with average grade 92.5
    There are 3 ok students with average grade 73.3333
    There are 2 failre students with average grade 56.5

    Requirements and restrictions:
    Use the scanner class for reading from file.
    Use the Student.java class from the course website to represent each student record and extend it to handle the grade categories.
    Print the student records (name, grade and grade category) using the println method with only a student object passed to it (hint: modify the toString method in class Student to return also the grade category).
    When you write your program
    use proper names for the variables suggesting their purpose.
    format your code accordingly using indentation and spacing.


    We were given this code to start with:
    public class Student
    {
    String fname, lname;
    int grade;

    public Student(String fname, String lname, int grade)
    {
    this.fname = fname;
    this.lname = lname;
    this.grade = grade;
    }

    public String toString()
    {
    return fname + " " + lname + "\t" + grade;
    }
    }

    Any help is greatly appreciated I'm clueless over here.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,475
    My Mood
    Hungover
    Thanks
    144
    Thanked 641 Times in 548 Posts

    Default Re: Can someone please help me get a start on this project?

    How to Program (stuck on homework? READ THIS BEFORE POSTING)
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. How to start
    By ashwinjava in forum Member Introductions
    Replies: 2
    Last Post: January 29th, 2012, 03:03 PM
  2. Where do i start?
    By cejay in forum Java Theory & Questions
    Replies: 9
    Last Post: September 10th, 2011, 04:21 PM
  3. Start With JAVA
    By infoprovider in forum The Cafe
    Replies: 2
    Last Post: July 28th, 2010, 04:34 AM
  4. [SOLVED] selection end and start
    By nasi in forum What's Wrong With My Code?
    Replies: 13
    Last Post: May 10th, 2010, 04:05 AM
  5. Where to start?
    By tonykasdorf in forum Java Theory & Questions
    Replies: 3
    Last Post: March 4th, 2010, 10:52 PM