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: Grades project/arrays, loops

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

    Default Grades project/arrays, loops

    Please help!
    I don't know what to do for this grades project. Any help would be great!!!

    These are the directions:

    You are not to modify any code provided. The program is to compute the average of several grades and find the letter grade equivalent. All the grades are in the grades table. The program is to process any number of grades in the table without the user entering anything. The program is to use two loops which are nested.

    For each grade:
    Find the location of the letter grade in the letter_grades table.
    The numeric equivalent is in the grades table.
    Total the numeric equivalent values.

    After all grades processed:
    Compute the grade point average.
    Look up the equivalent letter grade using another loop.

    For loops will work.

    The output should look like this:

    Average: 0.7140000000000001
    Grade: C-
    public class Project2 {
      public static void main(String[] args) {
        String[] letter_grades = new String[12];
        double[] grades = new double[12];   
        letter_grades[0] = "A";
        letter_grades[1] = "A-";
        letter_grades[2] = "B+";
        letter_grades[3] = "B";   
        letter_grades[4] = "B-";
        letter_grades[5] = "C+";
        letter_grades[6] = "C";   
        letter_grades[7] = "C-";
        letter_grades[8] = "D+";
        letter_grades[9] = "D";
        letter_grades[10] = "D-";
        letter_grades[11] = "F";
        grades[0] = .93;
        grades[1] = .90;
        grades[2] = .87;
        grades[3] = .83;
        grades[4] = .80;
        grades[5] = .77;
        grades[6] = .73;
        grades[7] = .70;    
        grades[8] = .67;
        grades[9] = .63;
        grades[10] = .60;
        grades[11] = .0; 
        String[] grades_entered = new String[10];
        grades_entered[0] = "B";
        grades_entered[1] = "C+";
        grades_entered[2] = "D-";
        grades_entered[3] = "C+";
        grades_entered[4] = "D-"; 
     
    //Your code goes here
     
      }
    }


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

    Default Re: Grades project/arrays, loops

    Duplicate post at java-forums.org!

Similar Threads

  1. help with loops... :(
    By Macgrubber in forum Loops & Control Statements
    Replies: 2
    Last Post: November 2nd, 2010, 12:38 PM
  2. Need help with project that uses arrays
    By jellyrole in forum Collections and Generics
    Replies: 8
    Last Post: October 28th, 2010, 08:36 AM
  3. Help with Nested Loops
    By Plural in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 23rd, 2010, 03:31 PM
  4. need help with loops plz
    By Kilowog in forum Loops & Control Statements
    Replies: 4
    Last Post: September 28th, 2009, 08:11 AM
  5. Replies: 11
    Last Post: April 29th, 2009, 03:12 AM

Tags for this Thread