Help I'm a Java Dummy, Please Help

Discussion in 'Java' started by Gessa_tech, Oct 9, 2006.

  1. Gessa_tech

    Gessa_tech Guest

    Hey guys I'm Gessa
    I recently started my graduate studies where I have to take at least
    programming two, the last programming class I took was in my associates
    degree and one in the beginning of my bachelor's degree. And need some
    real help with some code and how to solve some problems if any of you
    can find the time to help me it would deeply appreciate this. Feel free
    to e mail me in private concerning my problem I will at one of them to
    this topic so that if you can and want to assist me you can see what I
    am having trouble with.

    Thank you for your help and attention

    1* This is the driver for the Course object. We have used methods
    rather than the code given by Liang to illustrate
    more examples of how class objects are passed into these methods and to
    show how references to objects are the
    means for changing the referenced object's state. *1
    import java.uti!. *;
    public class TestCourse
    private static final String TERMINAL_NAME = "Q";
    private static Scanner keyboard = new Scanner(;
    public static void main(String( ] args)
    II String value that terminates user input
    Course course 1 = new Course("Data Structures");
    Course course2 = new Course("Database Systems");
    addStudents( course 1);
    System.out.println( );
    addStudents( course2);
    System.out.println( );
    showCourse( course 1);
    System.out.println( );
    showCourse( course2);
    1* Adds students to a course from keyboard input until the user enters
    the value of TERMINAL_NAME, thus
    indicating that no more students will be added to the course. *1
    private static void addStudents(Course theCourse)
    String name;
    II user-entered name of student to be added to the course
    System.out.println("Enter names of students to enroll in II +
    theCourse.getCourseName( »;
    System.out.println("Terminate the input with the name II +
    while (!(name = getName( ».equals(TERMINAL_NAME»
    theCourse.addStudent(name );
    II Returns string value from user input; kind of a glitzy way to do it
    with the use of a local String, but it works.
    private static String getName( )
    System.out.print("Name? ");
    return keyboard.nextLine( );
    1* Displays all the information about the specified course. Note how we
    are using the offset semantics on
    studentNumber *1
    private static void showCourse(Course theCourse)
    int enrollment = theCourse.getNumberOfStudents( );
    String name = theCourse.getCourseName( );
    System.out.println("Here are the II + enrollment + II students enrolled
    in II + name + ":");
    for (int studentNumber = 0; studentNumber < enrollment;)
    System.out.println(" Student #" + studentNumber + ": II +

    Now it is time for you to write the code for the application, which we
    will name
    ProcessACourse. Here is the pseudocode description of the main method
    to this application that
    that you must develop:
    instantiate object theCourse from keyboard input
    enroll students in theCourse from keyboard input
    display complete information abou tall values contained in theCourse
    use theCourse to find and dispIlf>I the average GP A 0/ the students
    get a reference to worstStudent, the one in theCourse with the lowest
    GP A '
    get a reference to bestStudent, the one in theCourse with the highest
    GP A
    display all the information contained in bestStudent and in
    theCourse = createCourse( )
    enroUStudents( theCourse)
    classAverage = getAverageGPA(theCourse)
    worstStudent = getWorstStudent(theClass)
    bestStudent = getBestStudent(theClass)
    showW orstAndBest(bestStudent, worstStudent)
    The above description, that refines the initial description virtually
    spells out the methods you
    must code to solve this problem. There is little more I need say other
    than "go write the code."
    However, I will make a few more points, one of which is a mandatory
    requirement while the
    others are strong suggestions:
    .. Even though the run of ProcessACourse (the application) suggests that
    you know the
    number of students before you get values for the students, you are not
    to assign a value to
    the instance variable numberOfStudents directly! Use a for loop in the
    method that will exit when the total number of students that should be
    in the course have
    been added. In other words, don't mess with the objects you have coded.
    Make the
    strategy suit the object rather than making the object suit the
    .. The create Course method only gets values for the courseName and the
    professorsName (that's all you need for the constructor, right?). The
    assignment of
    students is carried out in the enrollStudents method.
    .. The enrollStudents methodalready has a lot to do besides
    instantiating all the students in
    the theCourse. It displays some prompts, and it gets a value for the
    local variable that
    will be the numberOfStudents in the course. A smart approach to keep
    the code short is
    to write a sequence like
    student = theCourse.getStudent(studentNo); II get a reference
    student = createStudent(studentNo);
    II assign object to the reference

    .. an initial description for the for loops you will need to implement a
    number of the
    methods is as follows:
    for (int studentNo = 0; studentNo < totalStudents; )
    II additional code
    The value of totalStudents will be the same in every method that uses
    the for loop
    strategy, but the way to get this value may be different within some of
    the methods.
    I believe I have given you quite a bit on which to think. I am not
    expecting any sort of
    cookie-cutter code that is forced to resemble all the hints I have
    given. Just develop the methods
    you need to, and see if their final implementation is supported by the
    hints given. And let that be
    my final hint/suggestion!
    Gessa_tech, Oct 9, 2006
    1. Advertisements

  2. Sub: Help I'm a Java Dummy, Please Help

    That's odd, this sounds more like a troll!

    Gessa_tech wrote:

    ...and to quote your own homework..

    > Now it is time for you to write the code for the application,

    > ...And let that be my final hint/suggestion!

    Andrew T.
    Andrew Thompson, Oct 9, 2006
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. C not so sharp

    Dummy needs help with MapPath

    C not so sharp, Jun 9, 2004, in forum: ASP .Net
    Jun 11, 2004
  2. Replies:
    Chris Uppal
    May 5, 2005
  3. KK
    Big Brian
    Oct 14, 2003
  4. MuZZy
    Mike Hewson
    Jan 7, 2005
  5. Simon Brooke

    Help! 'dummy.xsl' ?

    Simon Brooke, Mar 18, 2007, in forum: XML
    David Carlisle
    Mar 20, 2007
  6. Gina_Marano

    XSL help needed for dummy

    Gina_Marano, May 30, 2007, in forum: XML
    roy axenov
    May 31, 2007
  7. Ruby Newbee

    help on the dummy module

    Ruby Newbee, Jan 20, 2010, in forum: Ruby
    Ruby Newbee
    Jan 20, 2010
  8. Michael Swift

    Javascript dummy needs help.

    Michael Swift, Jan 8, 2010, in forum: Javascript
    Michael Swift
    Jan 8, 2010