JAVA abstract interface implementation polymorphism all in this
<p>I created an interface to return the total score for a course 
I created an abstract class to keep basic course information. The class should also implement the interface above.</p>

<pre><code>public interface Course {
    public double totalScore();
}


abstract public class BasicInfo {
    string course_name;
    int course_year;
    course()
    {
        super();
    }
    course(String coursename, int couse_year) {
        super(n,s);
    }
}

public class BasicInfo implements Course {
    public double TotalScore(string cname, double mid1, double mid2,double hw1,double hw2, double final, double lab)
    {
        if(string cname.equals("compe 431")
        tscore431= (0.20* mid1)+ (0.20 * hw1) + (0.60 * final) ;
        else if (string cname.equals("compe 226")
        tscore226= (0.20* mid1)+ (0.20 * mid2) + (0.20* lab) + (0.40 * final) ;
        else
        tscore112= (0.30* mid1)+ (0.30 * hw1) + (0.10 * hw2) + (0.30 * final);
        public double getYear(string year){
        super.year;}
    }
}

class compe431 extends BasicInfo{
    compe431() { n=name; y=year; g=grade; }
}

class compe226 extends BasicInfo{
    compe226() { n=name; y=year; g= grade; }
}

class compe112 extends BasicInfo{
    compe112 () { n=name; y=year; g=grade; }
}
</code></pre>
