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: help with the logic on this letter grade program.

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Location
    norcross, ga
    Posts
    24
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Cool help with the logic on this letter grade program.

    hey,

    help me think of a good way to get after the logic of this program:


    ---------------------
    Write a program that translates a number into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-. Break ties in favor of the better grade; for example, 2.85 should be a B.
    Use a class Grade with a method getLetterGrade().


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: help with the logic on this letter grade program.

    What ideas did you have?

    Here's a simple hint: If-then-else statements

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

    etidd (January 28th, 2010)

  4. #3
    Junior Member
    Join Date
    Jan 2010
    Location
    norcross, ga
    Posts
    24
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default Re: help with the logic on this letter grade program.

    my idea was to have a couple of local double variables with a constructor public Grade(double value) that constructor's parameter is what receives the user input from the tester class. then, i would have a series of if-else if statements inside the method getLetterGrade(). even though you just offered a simple hint, that really helped, so i award you a thanks.

Similar Threads

  1. Grade Array Trouble
    By kite98765 in forum Collections and Generics
    Replies: 3
    Last Post: January 7th, 2010, 08:14 PM
  2. Simple recursion logic
    By chronoz13 in forum Algorithms & Recursion
    Replies: 3
    Last Post: December 24th, 2009, 10:53 PM
  3. Help with JAVA (Grade Book)
    By Sara_21 in forum Java Theory & Questions
    Replies: 2
    Last Post: November 30th, 2009, 10:16 PM
  4. letter to number
    By silverspoon34 in forum Java Theory & Questions
    Replies: 1
    Last Post: November 27th, 2009, 07:01 AM
  5. Grade averaging program with array and multiple methods.
    By jeremykatz in forum What's Wrong With My Code?
    Replies: 8
    Last Post: November 9th, 2009, 09:44 PM