Hello, attached below I’ve pasted a very simple and straight forward starter code (Java).
Within the code, you will find comments that will walk you through the process step by step with detailed instructions to complete the code.
(Then, attached below that, you will find pasted test code in order to test the program for completion.)
If you have any questions, please let me know.
Thank you so much in advance!
**********************************************************************************************
package practiceOOP;

import java.io.*;
import java.io.IOException;
import java.nio.file.*;
import java.util.*;
/** A class that represents a University */
public class University {
// Instance variables
private String name; // name of the university (like University of San Francisco)
private List students; // list of students at this university

/**
* Constructor for class University.
* Takes the name of university as a parameter
* @param name name of university
*/
public University(String name) {
// TODO: initialize instance variable name

// TODO: Initialize ArrayList students
}

/**
* Create a student a student with this name and id and
* add the student to the list of students
* @param studentName name of the student
* @param studentId id of the student
*/
public void addStudent(String studentName, int studentId) {
// TODO: create a student with this name and id

}

/** Return true if a person with the given name is a student at this university,
* and false otherwise.
* For the purpose of this exercise we assume that names are unique.
* @param name name of the person
* @return true if this person is a student at this university
*/
public boolean findStudent(String name) {
// TODO: check if the student with this name is in the ArrayList

return false;
}

/**
* Return a string representation of the university
* @return a string that contains the name of the university on the first line, and
* then includes students, one on each line:
* name, id
*/
public String toString() {
// TODO: return a string representation of the university – see description above

return null; // remember to change this
}

/**
* Sorts the ArrayList of students by name in increasing order.
*/
public void sort() {
// TODO: sort students.
// No need to implementing sorting from scratch. You may use Collections.sort method

// Note: implement compareTo method in class Student first for sorting to work

}
}
**********************************************************************************************import org.junit.Assert;
import org.junit.Test;
import practiceOOP.University;

public class UniversityTest {

@Test
public void testAddStudent() {
University uni = new University(“USF”);
uni.addStudent(“Elizabeth Lee”, 527);
uni.addStudent(“Matthew Jordan”, 252);

String str = uni.toString();
Assert.assertEquals(str, “Elizabeth Lee, 527” + System.lineSeparator() +
“Matthew Jordan, 252”);

}

@Test
public void testFindStudent() {
University uni = new University(“USF”);
uni.addStudent(“Elizabeth Lee”, 527);
uni.addStudent(“Matthew Jordan”, 252);

boolean foundSt1 = uni.findStudent(“Elizabeth Lee”);
Assert.assertTrue(foundSt1);

boolean foundSt2 = uni.findStudent(“Justin Meyers”);
Assert.assertFalse(foundSt2);
}

@Test
public void testSort() {
University uni = new University(“USF”);
uni.addStudent(“Elizabeth Lee”, 527);
uni.addStudent(“Matthew Jordan”, 252);
uni.addStudent(“Fatima Ghrahamani”, 145);

uni.sort();
String str = uni.toString();
Assert.assertEquals(str, “Elizabeth Lee, 527” + System.lineSeparator() +
“Fatima Ghrahamani, 145” + System.lineSeparator() +
“Matthew Jordan, 252”);

}
}




Why Choose Us

  • 100% non-plagiarized Papers
  • 24/7 /365 Service Available
  • Affordable Prices
  • Any Paper, Urgency, and Subject
  • Will complete your papers in 6 hours
  • On-time Delivery
  • Money-back and Privacy guarantees
  • Unlimited Amendments upon request
  • Satisfaction guarantee

How it Works

  • Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
  • Fill in your paper’s requirements in the "PAPER DETAILS" section.
  • Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
  • Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
  • From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.