Results 1 to 4 of 4

Thread: Sum of GPA

  1. #1
    hoangx87 is offline Member
    Join Date
    Mar 2011
    Posts
    44
    Rep Power
    0

    Default Sum of GPA

    Instruction:

    Write StudentStatisticCalculator.java
    An interface with two methods:
    getName(), which returns a String
    computeStatistic(Student[] students), which returns a double

    You'll write 4 classes that implement the StudentStatisticCacluator interface,
    to find the sum, min, max, and average gpa in the student array passed to printStatistic.



    public interface StudentStatisticCalculator{


    public String getName();


    public double computeStatistic(Student[] students);


    }





    public class SumGpa implements StudentStatisticCalculator {

    String name;


    public SumGpa(){
    }

    public String getName(){
    return name;
    }

    public double computeStatistic(Student[] students){
    return 1;
    }


    public static void main(String args[]){
    SumGpa s=new SumGpa();


    }



    }

    I was wondering if I am missing something, and I would like to know what would i have to do to get the sum of the gpa.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Why did you make this new thread for the same basic question?

  3. #3
    hoangx87 is offline Member
    Join Date
    Mar 2011
    Posts
    44
    Rep Power
    0

    Default

    i guess it was a different question now.

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    I posted something in the previous thread. While this is compilable and runnable what happens when you call compute? Does it produce the sum of the argument array?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •