/*
 * File: BlankClass.java
 * ---------------------
 * This class is a blank one that you can change at will. Remember, if you change
 * the class name, you'll need to change the filename so that it matches.
 * Then you can extend GraphicsProgram, ConsoleProgram, or DialogProgram as you like.
 */



import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.*;

import acm.program.*;
import acm.util.RandomGenerator;

public class SpreadTheWord extends ConsoleProgram {

	private static final int N_CONNECTIONS_PER_STUDENT = 5;
	private static final String NICK_EMAIL = "troccoli@stanford.edu";
	private static final String TEST_EMAIL = "cs106a.winter.16@gmail.com";
	
	public void run() {
		// your code here...
		
		println("\nAll Done");
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	private void loadStudentEmailAddresses() {
		try {
			BufferedReader rd = new BufferedReader(new FileReader("emails.txt"));
			while(true) {
				String line = rd.readLine();
				if(line == null) break;
				String[] cols = line.split(",");
				String name = cols[0];
				String email = cols[1];
			}
			rd.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	// generate text for the email
	public String generateEmailText(String studentName) {
		String text = "";
		
		// the preamble
		text += "Dear " + studentName + ",\n\n";
		text += "I hope this email finds you well.\n\n";
		text += "As you know, CS106A is a huge class with many wonderful people in it. ";
		text += "In lecture today we built a program to help you meet a few fellow students. ";
		text += "Here are five random people in CS106A. ";
		text += "You can (optionally) introduce yourself:\n";

		//List<StudentEmailAddress> allStudents
		RandomGenerator rg = RandomGenerator.getInstance();
		for(int i = 0; i < N_CONNECTIONS_PER_STUDENT; i++) {
			text += " " + "Chris" + ", " + "piech@cs.stanford.edu" + "\n";
		}

		// the end of the email
		text += "\n";
		text += "All the best,\n";
		text += "Chris";
		text += "\n\n";
		text += "P.S. This email was generated by some Java code.\n";
		text += "P.P.S. Today we covered 'classes' which introduces a whole new way of thinking about programs :-)";
		return text;
	}



}

