package option1.stage4;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import option1.stage1.*;
import option1.stage2.*;
import option1.stage3.*;
public class AppointmentDiary {
private String practiceName;
private ArrayList<Appointment> appointments;
private ArrayList<Doctor> doctors;
/**
* DO NOT MODIFY
* initialize an empty appointment diary
*/
public AppointmentDiary() {
practiceName = “TBA”;
appointments = new ArrayList<Appointment>();
doctors = new ArrayList<Doctor>();
}
/**
* DO NOT MODIFY
* Read appointment diary from the data files
* @param name
* @param filenameDocs
* @param filenameAppointments
* @throws Exception
*/
public AppointmentDiary(String name, String filenameDocs, StringfilenameAppointments) throws Exception {
practiceName = name;
appointments = new ArrayList<Appointment>();
doctors = new ArrayList<Doctor>();
Scanner scanner = new Scanner(new FileReader(filenameDocs));
for(int i=0; i < 4; i++) { //ignore first 4 lines
scanner.nextLine();
}
String line;
while(true) {
try {
line = scanner.nextLine();
}
catch(Exception e) {
break;
}
line = line.trim();
String[] tokens = line.split(“, “);
doctors.add(new Doctor(tokens[0].trim(),
PayPal Gateway not configured
PayPal Gateway not configured