CS111 Programming Assignment 6




Program 1


Write a Java program that creates a file containing what you ate for breakfast.
Store this file to your desktop.
Include at least 5 breakfast items, such as blueberry waffles, hashbrowns, a muffin, coffee, and strawberries and bananas.
Perform exception handling using try/catch blocks.
Include a finally clause to close any opened files.



Program 2


Write a program to read the breakfast document (from question 1) located on your desktop. Count the number of words ending in a vowel or s.


Program 3

Write a Java program that creates a linked list of student data. Use your own implementation of a linked list, such as Linked from Lab 9.

Assume student information consists of the student's first name, last name, and test score. Store this data in a linked list of nodes representing each student. Build the linked list so that student nodes are organized in ascending order based on test score. The data in each student node of this linked list should contain a person's first and last name and test score.

Use the test code shown below to test your linked list.
public class Test {
    public static void main(String[] args) {
      // TASK 1: CREATE AN EMPTY LINKED LIST
      Linked students = new Linked();

      //ADD STUDENTS TO THE LIST
      students.addNode("Roger", "Baca", 70);
      students.addNode("Suzy", "Davis", 98);
      students.addNode("Bobo", "Green", 50);
      students.addNode("Cat", "Ling", 85);
      students.addNode("Ken", "Molich", 99);

      students.display();
    }
}


Output
Bobo Green scored 50
Roger Baca scored 70
Cat Ling scored 85
Suzy Davis scored 98
Ken Molich scored 99