1) Object-Oriented Programming 2) Help reduce redundancy with customized types. Can create more complicated program with virtual objects. 3) A class type is a type for a class, that is, a type for objects with both data and methods. A primitive type is a simpler type. Values of a primitive type are not complex items but simple, indecomposable values. 4) // Search for student with highest gpa and return name: public static String maxGPA(String s1, double g1, String s2, double g2, String s3, double g3, String s4, double g4, String s5, double g5) { double max = g5; // assume max gpa is 3rd gpa String s = s5; // name of student with max gpa if (g1 > max) { max = g1; s = s1; } if (g2 > max) { max = g2; s = s2; } if (g3 > max) { max = g3; s = s3; } if (g4 > max) { max = g2; s = s4; } return s+": "+max; } 5) //returns the average GPA of all students in array s public static double avgGPA(Student[] s) { double sumGPA = 0.0; for (int i=0; i=0) return real+"+"+imag+"i"; else return real+""+imag+"i"; } } 7) public class TestPerson { public static void main(String[] args) { Person p1 = new Person("Adam",145.6); Person p2 = new Person("Bob",156.7); p1.compare(p2); } } class Person { // fields private String name; private double weight; // constructor public Person(String n, double w) { name = n; weight = w; } // methods public void compare(Person other) { double diff = weight - other.weight; if(diff > 0) System.out.println(name+" is heavier."); else if(diff < 0) System.out.println(other.name+" is heavier."); else System.out.println("They have the same weight."); } public String toString() { return name+":"+weight; } }