The collections framework is a unified architecture for representing and manipulating collections, enabling them to be manipulated independently of the details of their representation. It reduces programming effort while increasing performance.
The framework is based on more than a dozen collection interfaces. It includes implementations of these interfaces and algorithms to manipulate them.
Data (this code should be in GradeBook’s main):
Student alice = new Student("Alice", new double[]{100, 80, 95, 85, 92});
Student peter = new Student("Peter", new double[]{98, 88, 92, 83, 87});
Student joan = new Student("Joan", new double[]{75, 80, 78, 82, 72});
Student alex = new Student("Alex", new double[]{100, 98, 95, 96, 93});
Student julienne = new Student("Julienne", new double[]{100, 100, 98, 95, 92});
Student philip = new Student("Philip", new double[]{88, 82, 85, 85, 82});Output:
1. Julienne: 97.0
2. Alex: 96.4
3. Alice: 90.4
4. Peter: 89.6
5. Philip: 84.4
6. Joan: 77.4
Submit your Student.java and GradeBook.java (GradeBook has main with the print statements) to gradescope
Create a PhoneBook class that stores contact information (Name + Phone Number). Phone number should be exactly 10 digits.
String.valueOf(phoneNumber).length() == 10 for validation of the Long variable.add(String, Long) and .get(String) should be constant time for runtimePhoneBook.java to gradescopeTest code:
public static void main(String[] args) {
PhoneBook contacts = new PhoneBook();
// each of these add calls should be constant time
contacts.add("Wali", 5553428631L);
contacts.add("Emilia", 573147373L); // Invalid phone number
contacts.add("Seo-yun", 5552574665L);
contacts.add("Flor", 5559083456L);
System.out.println(contacts.length()); // 3
// each of these get calls should be constant time
System.out.println(contacts.get("Flor")); // 5559083456
System.out.println(contacts.get("Emilia")); // Contact not in PhoneBook
}Submit your PhoneBook.java to gradescope