Schedule

Vernam Probs

Monday (5/12 - 16)

Agenda:


Thursday (5/8)

Agenda:

  • Find and complete any missing practice exams
  • Complete May 2007 SL P2


Thursday (4/24)

Agenda:


Tuesday (4/22)

Agenda:


Friday (4/18)

Agenda:


Friday (4/11)

Wednesday (4/16)

Agenda:


Friday (4/11)

Agenda:

  • PRACTICE IB EXAM
  • You will be completing the following practice Papers1 of the IB exam. You must complete all parts of the exam by next class period (Wednesday)
  • You may complete the exam with a single partner. A partner is optional.
  • Record all your answers because we will be going over them as a class
  • Only resort to looking up answers as a LAST RESORT. It is best to discuss the question with your partner first.
  • You may obtain the practice exam here


Thursday (4/3)

Warmup:

  • You are asked to backup all the contents of a 1000 GB server. You may backup the server.s contents via networking or tape backup, and the backup copy must be stored at the backup location. Assume you have a 3 Mbit / s data connection to the backup location. If you physically mailed the server.s tape backups, it would take a week to reach the backup location. Which option is best to save time?
  • Assuming 8-bits and 2's complement, what is -9 in binary?
  • Assuming 8-bits and sign magnitude, what is -12 in binary?
  • Name 3 functions of a file manager

Agenda:

  • Computer Networking Quiz
  • Further System Fundamentals


Friday (2/15) - Friday (3/14)

Agenda:


Wednesday (2/13)

Agenda:

  • Turn in your Modular Organization
  • Errors!
  • Utility Software

Due: Dossier Criterion B3: Modular Organization due Today


Friday (2/1) - Monday (2/11)

Agenda:

  • Internet works.
  • Dossier Criterion B3: Modular Organization
  • Work on your dossier

Due: Dossier Criterion B3: Modular Organization due Wednesday 2/13


Friday (1/25) - Wednesday (1/30)

Agenda:

  • You will be creating two different programs for today's assignment. The programs will be using the RandomAccessFile class in order to read and write files. Please see the demo files below from last class if you are unfamiliar with how to read/write files.
  • FileOutputPractice program
    • The FileOutputPractice program will repeatedly prompt the user for words and write them out to file. When the user enters -1, then the program should end.
    • First, you should prompt the user for a filename
    • Create a new file using that filename and be sure to open it for writing
    • Repeatedly prompt the user to enter a word, and every time they enter a word, write it out to file
    • If the user ever inputs -1, then quit and your program should end
  • FileInputPractice program
    • The FileInputPractice program will prompt the user for a filename and an integer N. The program should read the file and print out the first N words from the file
    • First, you should prompt the user fo ra filename
    • Open the user's file and be sure to open it for reading
    • Read the first N words into a String array
    • After reading all the words into an array, iterate through the array and print out the N words from the array
    • CHALLENGE: If the user enters a number greater than the number of words in the file, then print an error
  • Once you have completed both programs, you should work on your dossier. You must be able to show Mr. Bui significant progress on your dossier by next week. This progress check will be for a grade!

Due: FileInput/OutputPractice programs are due at the beginning of class on Wednesday 1/30

Due: Dossier code progress check! You must show progress on your dossier for a grade!


Wednesday (1/23)

Warmup:

  • Outline three main methods of systems implementation [6 marks]

  • State the efficiency of the general algorithm used for a:
    • Linear search of an array [1 mark]
    • Binary search [1 mark]

  • Calculate the result of the hexadecimal addition. FD + AB = ? (Show answer in hexadecimal format) [2 marks]

  • The following questions all relate to a computer that uses 7 bits to represent integers using 2's complement.
    • Calculate the following:
      • minimum integer value that can be represented [1 mark]
      • maximum integer value that can be represented [1 mark]
    • Determine the result of the addition 0111101 + 0111110 (show answer in binary format [2 marks]
    • Explain the error that has occurred [2 marks]
    • Explain the likely impact on the running of a program if this general type of error occurs [2 marks]
    • Discuss how a Java programmer can prevent such errors [2 marks]
  • An automated robot is used to cut shapes from steel sheets. If the robot's cutting blade becomes both hot and blunt the robot must stop so that the blade can cool and be resharpened. Sensors S1 (hot state) and S2 (blunt state) are attached to the blade to detect these states. Water from a container is used to keep the blade cool during cutting. If the water level falls below a certain point a sensor S3 detects this state and the robot stops irrespective of the other states. A logic circuit is required to control the robot so that it stops cutting when the appropriate states occur.

    • Complete the following truth table and complete it to represent the above logic: [3 marks]

      A (S1) B (S2) C (S3) Stop
      0 0 0 0
             
             
             
             
             
             
             

    • From the truth table write the full Boolean expression showing all terms [2 marks]
    • Simplify the above full Boolean expression (clearly show the method used). [3 marks]
    • Draw the circuit diagram for the simplified Boolean expression [2 marks]

Agenda:

  • Go over practice IB exam questions
  • Introduction to Computer Architecture
  • Writing to file using RandomAccessFile. Download and run the demo
  • Reading from file using RandomAccessFile. Download and run the demo
  • A more advanced example of RandomAccessFile can be found here
  • Work on Dossier


Friday (1/18)

Warmup:

  • Add the following hexadecimal numbers together and write them out in hexadecimal form: 1111 + 1234 = ?, 54ab + a23e = ?
  • Assuming 2's complement, which of the above numbers are negative? What is the decimal value of the negative number(s)?
  • Assuming 8-bit 2's complement, what is the binary version of -43?

Agenda:

  • Draw the logic circuits for the following Boolean expressions:
    • z = A + B'C' + A'BC
    • z = B(A + C) + AC
    • z = (AB)' + A'C
  • Work on your dossier

Wednesday (1/16)

Warmup:

  • What is the maximum value possible if you were restricted to 10 bits using sign magnitude? and the minimum value?
  • Find the decimal version of the following 2's complement numbers: 10111011, 11010111, 11111111

Agenda:

  • 2's complement review
  • Analog vs. Digital
  • No quarter exam


Monday (1/14)

Warmup:

  • Write out the *complete* Boolean expression for the truth table on the board. Hint: You should first write out all the miniterms
  • Simplify the Boolean expression
  • Draw the logic circuit for the simplified Boolean expression

Agenda:

  • Turn in your Dossier B2: Algorithms sections by the end of today
  • Adder circuits
  • Sign Magnitude
  • 2's complement

Due: Dossier B2: Algorithms due today

Due: 2nd Quarter exam on 1/23


Tuesday (1/8) - Thursday (1/10)

Warmup:

  • Create a Java class for the basic data container in your dossier
  • For example, if you are creating a book database, then you should create a Book class. The Book class should contain appropriate attributes and methods
  • Another example would be creating a student database, then you should be creating a Student class.
  • If you have already started your dossier coding and have finished this component, then you should be planning on paper the different parts of your dossier system

Agenda

  • Binary Quiz
  • Introduction to Hexadecimal
  • Binary Addition
  • Review:
    • Binary data prefixes
    • Data representation
    • Max/Min Values
  • Boolean practice: Write out the truth table for your assigned problem. Also, simplify it further if you can
    1. AB + BC'
    2. (A+B)C
    3. A' + BC + C'
    4. BC + A'
    5. (ABC)' + AB
    6. A' + B(A + C)
    7. AB + BC + (AC)'
    8. ABC + AB'C + A'BC
    9. A'BC' + (AB)' + BC
    10. AB + (BC)' + A'BC
    11. (A + B)C' + AB
    12. ABC + (AB)'C + A'BC
  • Introduction to Logic Gates

Due: Dossier B2: Algorithms due at the end of the week


Thursday (1/3) - Friday (1/4)

Warmup:

  • Convert the following binary numbers to decimal: 11011, 00110, 00011111
  • Convert the above binary numbers to hexadecimal
  • Convert the following decimal numbers to binary, 23, 63, 34

Agenda

  • Turn in ANYTHING additional you have completed for your dossier
  • Dossier B1: Data Structures was due before break
  • Dossier B2: Algorithms
  • Boolean Expressions Review
    • Write out the truth table for AB + ~(AB) + ~AB
    • Simplify the following boolean expression:

      ABC' + AB'C + A'BC + ABC

Due: Dossier B2: Algorithms due at the end of next week


Wednesday (12/12)

Warmup:

  • Arrange yourselves alphabetically like last class
  • State which data type is best for storing a telephone number (e.g. 01623 440325) and give two reasons why.
  • State what type of search would always be used on unsorted data and explain why

Agenda:

  • If a is an int array of length 2 and a[0] and a[1] hold values 7 and 13 respectively, what are their values after fun(a) is called? The method fun is defined as follows:

    public void fun(int [] x)
    {
      x[0] = (int)(100.0 * x[0] / (x[0] + x[1]));
      x[1] = (int)(100.0 * x[1] / (x[0] + x[1]));
    }
  • Pair up with the person next to you and discuss your answers
  • Classroom discussion of tracing code
  • StringBinaryTree
    • Convert your BinaryTree into a StringBinaryTree
    • Remember, you cannot simply compare Strings in Java, you must use: compareTo()
    • Test out your new binary tree by inserting and printing out the tree in order. Insert the words: "hello", "goodbye", "washington", "lee", and "generals"
  • Work on your Dossier B1: Data Structures sections. It is due by the end of this week.
  • You may also begin coding your dossier. You should first start making the main data container involved in your dossier. Example Java classes to begin working on:
    • Book
    • Salary
    • Person
    • ...etc
  • When done coding your "main data thing," you should now integrate it into your old LinkedList or BinaryTree. You should choose which structure to use, pending on what you need for your dossier. DO NOT OVERWRITE YOUR OLD CODE...save the file as something different (e.g. BookLinkedList).
  • Due: StringBinaryTree due at the end of today

    Due: Dossier B1: Data Structures due at the end of this week


    Monday (12/10)

    Warmup:

    • Arrange yourselves alphabetically like last class

    Agenda:

  • Assume you are given the following code:

  • int m = 20, n = 2, temp;
    for (int count = 1; count <= 20; count++)
    {
        temp = m;
        m = n + count;
        n = temp - count;
    }
  • What are the values of m and n after the following code runs? You should trace through the code with a pencil and paper.
  • Pair up with the person next to you and discuss your answers
  • Classroom discussion of tracing code
  • StringBinaryTree
    • Convert your BinaryTree into a StringBinaryTree
    • Remember, you cannot simply compare Strings in Java, you must use: compareTo()
    • Test out your new binary tree by inserting and printing out the tree in order. Insert the words: "hello", "goodbye", "washington", "lee", and "generals"
  • Work on your Dossier B1: Data Structures sections.
  • You may also begin coding your dossier. You should first start making the main data container involved in your dossier. Example Java classes to begin working on:
    • Book
    • Salary
    • Person
    • ...etc
  • When done coding your "main data thing," you should now integrate it into your old LinkedList or BinaryTree. You should choose which structure to use, pending on what you need for your dossier. DO NOT OVERWRITE YOUR OLD CODE...save the file as something different (e.g. BookLinkedList).
  • Due: StringBinaryTree due at the end of Wednesday

    Due: Dossier B1: Data Structures due at the end of this week


    Thursday (12/6)

    Warmup:

    • Arrange yourselves alphabetically by last name
    • Which of the Big-O notations is the fastest?
    • What is the Big-O evaluation for linear search?
    • What is the Big-O evaluation for binary search?

    Agenda:

  • Big O Practice
    • 5-10 mins: compute the Big-O evaluations for the practice sheet
    • Pair up with the person next to you (alphabetically)
    • Discuss your answers and why
  • Finish your BinaryTree
  • Demo your BinaryTree by doing the following:
    • Create a test program that creates a new BinaryTree
    • Print out whether or not the tree is empty using the isEmpty() method
    • Insert the following numbers: 3, 7, 16, 4, 5
    • Print the tree using the print() method
    • Print whether or not 16 is in the tree using the find() method
    • Print whether or not 20 is in the tree using the find() method
  • Work on your Dossier B1: Data Structures sections.
  • You may also begin coding your dossier. You should first start making the main data "thing" involved in your dossier. Example Java classes to begin working on:
    • Book
    • Salary
    • Person
    • ...etc
  • When done coding your "main data thing," you should now integrate it into your old LinkedList or BinaryTree. You should choose which structure to use, pending on what you need for your dossier. DO NOT OVERWRITE YOUR OLD CODE...save the file as something different (e.g. BookLinkedList)
  • Due: Dossier B1: Data Structures due at the end of next week (Thursday/Friday)


    Tuesday (12/4)

    Warmup:

    • What abstract data type (ADT) would best be used for the printing system in our room? (The first person to print should be the first person to get their paper)
    • The undo/redo feature of MS Paint would best use which ADT?
    • What is the benefit of using a binary tree?
    • What is the worst case scenario for searching a binary tree? e.g. If a binary tree contains N nodes, in what SPECIFIC scenario would I search through all N?

    Agenda:

    • Show Mr. Bui your Prototype solution for late credit
    • User interface design
    • Dossier B1: Data Structures - Due at the end of next week - Thursday/Friday
    • Example data structures
    • Introduction to Algorithm Evaluation
    • Big O Practice
    • Finish your BinaryTree
    • Demo your BinaryTree by doing the following:
      • Create a test program that creates a new BinaryTree
      • Print out whether or not the tree is empty using the isEmpty() method
      • Insert the following numbers: 3, 7, 16, 4, 5
      • Print the tree using the print() method
      • Print whether or not 16 is in the tree using the find() method
      • Print whether or not 20 is in the tree using the find() method

    Due: BinaryTree class due at the end of class today

    Due: Dossier B1: Data Structures due at the end of next week (Thursday/Friday)


    Friday (11/30)

    Warmup:

    • Using Mr. Bui's BTNodeTestMain as a guide, create your own binary tree using BTNodes.
    • Link BTNodes together with the following numbers (in order): 24, 74, 4, 65, 23
    • Run your new BTNodeTestMain class and it should print out the numbers in order.
    • Demo your warmup to Mr. Bui because it is being counted for a grade

    Agenda:

    • Take out your prototype solutions and get checked off by Mr. Bui
    • User interface design and evaluation
    • Prototype solution feedback activity
    • Implement the BinaryTree class and the methods we listed in class
      • You should have one BTNode attribute for the root
      • Create a default constructor
      • Implement the following methods:
        • boolean isEmpty()
        • BTNode getRoot()
        • void print() - calls printSubtree() using the root
        • void printSubtree(BTNode current) - I gave you this...
        • boolean find(int num) - calls findSubtree() using the root
        • boolean findSubtree(int num, BTNode current) - looks like print() but finds the num instead of printing
        • MR. BUI WILL GO OVER AND HELP YOU WITH THE FOLLOWING METHODS: here
        • void insert(int num) - calls insertSubtree() using num and root
        • void insertSubtree(int num, BTNode current) - you can do this iteratively or recursively

    Due: Dossier Criterion A3: Prototype Solution due at the beginning of class today

    Due: BinaryTree class due at the end of class Tuesday (12/4)


    Wednesday (11/28)

    Warmup:

    • Take out a piece of paper
    • Draw a binary tree that inserts the following numbers in this order (order matters): 4, 8, 3, 7, 2, 1
    • Draw a new binary tree that inserts the following numbers in this order: 12, 76, 84, 23, 56, 11
    • Draw one last binary tree that inserts the following numbers in this order: 1, 5, 8, 10, 15

    Agenda:

    • Complete the Binary Tree Node (BTNode)
    • Demo the BTNode to Mr. Bui using his test
    • Introduction to Recursion
    • Test out factorial() and fibonacci() in Java
    • Introduction to the Binary Tree class
      • What attributes would we need?
      • What methods would we need?
      • Binary tree traversal - Mr. Bui's BTNodeTestMain
    • Implement the BinaryTree class and the methods we listed in class
      • You should have one BTNode attribute for the root
      • Create a default constructor
      • Implement the following methods:
        • boolean isEmpty()
        • BTNode getRoot()
        • void print() - calls printSubtree() using the root
        • void printSubtree(BTNode current) - I gave you this...
        • boolean find(int num) - calls find() using the root
        • boolean findSubtree(int num, BTNode current) - looks like print() but finds the num instead of printing
        • void insert(int num) - calls insertSubtree() using num and root
        • void insertSubtree(int num, BTNode current) - you can do this iteratively or recursively

    Due: Dossier Criterion A3: Prototype Solution due at the beginning of class on Friday (11/30)

    Due: BinaryTree class due at the end of class on Friday (11/30)


    Monday (11/26)

    Agenda:

    • Turn in your LinkedList class if you did not turn it in last week!
    • Doubly-Linked Lists
    • Circular Linked Lists
    • Introduction to Binary Trees!
      • Binary Tree Node
      • Binary Tree!
    • Work on your Dossier Criterion A3: Prototype Solution. If you have NOT completed your other dossier sections, then you CANNOT work on the prototype solution. WORK ON YOUR MISSING SECTIONS!
    • Binary Tree Node
      • Create a new class called BinaryTreeNode or BTNode
      • It should have three attributes: an int, and two BinaryTreeNode references (left and right). Make sure to give all three attributes default values
      • Create a default constructor for your BTNode
      • Create a specific constructor for your BTNode. The specific constructor should have three parameters, an int and two BTNode references.
      • Test out your BTNode with Mr. Bui's BTNodeTestMain.java

    Due: Dossier Criterion A3: Prototype Solution due at the beginning of class on Friday (11/30/07)


    Monday (11/19)

    Agenda:

    • Complete and turn in your LinkedList class
    • Dossier - Criterion A3: Prototype Solution
      • What is an "initial design?"
      • What is a protoype solution?
    • Work on your Dossier Criterion A3: Prototype Solution. If you have NOT completed your other dossier sections, then you CANNOT work on the prototype solution. WORK ON YOUR MISSING SECTIONS!

    Due: Dossier Criterion A3: Prototype Solution due after Thanksgiving break on 11/30/07


    Thursday (11/15)

    Agenda:

    • Introduction to Linked Lists - continued
      • attributes
      • constructor
      • boolean isEmpty()
      • void addToFront(int num)
      • void addToTail(int num)
      • void insert(int num, int index)
      • int removeFromFront()
      • int removeFromTail()
      • int remove(int index)
      • int size()
      • void print()
      • int getElementAt(int index)
    • Implement the remaining methods

    Due: LinkedList demo due before Thanksgiving break


    Tuesday (11/13)

    Warmup:

    • Name 3 data structures (concrete) that we have ever used
    • Name 2 abstract data types that we have ever used

    Agenda:

    • Complete your DynamicQueue! Turn it in at the end of today
    • Introduction to Linked Lists
      • What are they?
      • How do they work?
      • Let's think of some good methods...
    • Create a new class called LinkedList
    • Begin working on a LinkedList implementation

    Due: DynamicQueue.java and DynamicQueueTest.java is due at the end of today


    Thursday (11/8)

    Warmup:

    • Create a new Java class called DynamicStackTest
    • Declare and create a *new* instance of your DynamicStack
    • Print out a message that uses the isEmpty() function that tells the user if the stack is empty. Example: Is the stack empty? True
    • Using a for loop, iterate from 0 through 2007
      • Inside your for loop, push() the loop counter onto the stack
    • Using a second for loop, iterate from 0 through 2008
      • Inside this for loop, pop() the stack and print that which is popped
    • Lastly, print out a message that uses the top() function. Example: I'm done with my for loops and my top is: X
    • Show Mr. Bui your DynamicStack and DynamicStackTest code to get checked off!

    Agenda

    • You may check your grade on-line, and if you have any questions, please come talk to Mr. Bui *after* class
    • Review dynamic stack
    • Introduction to dynamic queue
      • What are the two locations on a queue we try to remember?
      • What does a queue look like when using nodes?
      • What are the behaviors of the queue data type?
    • Create a class called DynamicQueue
    • Like the DynamicStack class, you will need to use the Node class
    • Implement all the attributes and methods of a dynamic queue
      • You will need two Node attributes: head and tail
      • DynamicQueue() //default constructor
      • void add(int num)
      • int remove()
      • int getHead()
      • int getTail()
      • bool isEmpty()
      • void print()
    • Create a test class called DynamicQueueTest to test out your queue. Hint: You may reuse your other queue test main class


    Monday (11/5)

    Warmup:

    • Trace through NodeFunAgain.java and draw the memory diagrams on a separate piece of paper

    Agenda

    • Data Structure vs. Abstract Data Type
    • Re-Introduction to Stacks
      • Create a new class called DynamicStack
      • What attribute must we keep track of when we talk about stacks?
      • Create a Node reference for the most important stack attribute
      • Implement push(int num) using Nodes. push() should not return anything, but create a new Node with the value pushed onto the stack. Don't forget to update the top!
      • Implement pop(), which should POP and return the value on top of the stack and update the top
      • Implement top(), which should just return the value on top of the stack
      • Implement isEmpty() which returns true if the stack is empty
      • Implement print() which should print your entire stack
      • TEST YOUR STACK USING MR. BUI'S STACK MAIN OR YOUR OWN MAIN METHOD


    Thursday (11/1)

    Warmup:

    • Write a program that pushes the following words onto a stack: "done.", " is", " warmup", "Your"
    • Pop and print all the words on one line
    • HINT: Use your stack implementation that can store Strings
    • Raise your hand to get checked off by Mr. Bui

    Agenda:


    Tuesday (10/30)

    Agenda:

    • Hand back dossier "Analysis of the Problem"
    • Assuming that you are done with the Queue class, you should test out your Queue class using CircularQueueMain.java. Be sure to change all the CircularQueue instances to Queue. What you should find is that your Queue does not work
    • We shall create a new Queue class called CircularQueue
    • Circular Queues
      • Using your Queue class, copy it and rename it CircularQueue.java. You will then make the following changes to create a wrap-around circular queue. First, add a new attribute named size that keeps track of the number of elements added to the queue
      • Fix the add() method so that the tail wraps around back to index 0 if it reaches the end. REMEMBER, you must first check to see if the queue is full or not because you cannot wrap around if the queue is full. You should also increase size by one.
      • Fix the remove() method so that the head wraps around back to index 0 if it reaches the end. You should also decreasesize by one. Don't forget to check if the list is empty.
      • Fix the isEmpty() method so that it uses the size attribute
      • Fix the isFull() method so that it uses the size attribute
      • Fix the print() method so that the entire queue is printed from head to tail
      • You may test your queue using CircularQueueMain.java
      • Print out CircularQueue.java and hand it in to Mr. Bui
    • If you have completed CircularQueue.java, then you should go back and improve your Problem Analysis

    Due: CircularQueue.java is due at the end of today


    Friday (10/26)

    Warmup:

    • Pair up with a partner
    • Assume you have an array
    • One person should explain to the other how pop() should work in a stack
    • The other person should then explain how push() should work in a stack
    • Both people should agree on each others' algorithm

    Agenda:

    • Work on Queue!
    • When you are done with Queue, then you should test out your Queue class using CircularQueueMain.java. Be sure to change all the CircularQueue instances to Queue. What you should find is that your Queue does not work
    • We shall create a new Queue class called CircularQueue
    • Circular Queues
      • Using your Queue class, copy it and rename it CircularQueue.java. You will then make the following changes to create a wrap-around circular queue. First, add a new attribute named size that keeps track of the number of elements added to the queue
      • Fix the add() method so that the tail wraps around back to index 0 if it reaches the end. REMEMBER, you must first check to see if the queue is full or not because you cannot wrap around if the queue is full. You should also increase size by one.
      • Fix the remove() method so that the head wraps around back to index 0 if it reaches the end. You should also decreasesize by one. Don't forget to check if the list is empty.
      • Fix the isEmpty() method so that it uses the size attribute
      • Fix the isFull() method so that it uses the size attribute
      • Fix the print() method so that the entire queue is printed from head to tail
      • You may test your queue using CircularQueueMain.java
      • Print out CircularQueue.java and hand it in to Mr. Bui

    Due: Queue.java is due at the end of today


    Wednesday (10/24)

    Warmup:

    • Turn in your Criteria for Success
    • Identify the following parts in each of the method declarations: access type, return type, method name, parameters
      • public int getSize()
      • private String whatNot(String whatFor)
      • public void print(int size, String stuff)

    Agenda:

    • Discuss with a partner the behavior of a stack of trays in a cafeteria. Things to think about: when somebody picks up a tray, what happens? When trays are cleaned, where in the stack are they most easily placed?
    • Introduction to Data Structures - Stacks
    • The given Stack.java uses Strings. Fix the Stack.java file so that it works with StackMain.java and demo to Mr. Bui
    • Introduction to Data Structures - Queues
    • Fix Queue.java so that it works. You must fill in all the method bodies

    Due: Rough draft of Criteria for Success due today

    Due: Queue.java is due at the end of Friday (10/26)


    Thursday (10/18) - Monday (10/22)

    Agenda:

    • Dossier: Criteria for Success
    • If you have not completed the Problem Analysis, then you CANNOT do your Criteria for Success. You should work on your Problem analysis
    • Demo your Phonebook methods
    • Introduction to Data Structures - Stacks

    Due: Rough draft of Criteria for Success due next Wednesday (10/24)


    Tuesday (10/16)

    Agenda:

    • You must be able to demo the four new methods in the PhoneBook class by the end of today

    Due: Demonstrate the four methods in PhoneBook by the end of today


    Friday (10/12)

    Agenda:

    • Demo any missing assignmentes to Mr. Bui
    • Fix StringBinarySearch.
      • HINT: You will need to use the String class's compareTo() method.
      • Here is an example of using compareTo()
      • Here is another example of using compareTo()
    • You should add findContactLS(String fn, String ln) to your PhoneBook class. findContactLS() should go through your array in PhoneBook and return a Contact if it exists in the array and returns null if it is not in the array.
    • You should add selectionSort() which sorts your PhoneBook contact array by last name using the selection sort algorithm. You may assume that everybody will have a different last name.
    • You should add bubbleSort() which sorts your PhoneBook contact array by last name using the bubble sort algorithm. You may assume that everybody will have a different last name.
    • You should test all your methods to make sure they work!
    • You should add findContactBS(String fn, String ln) to your PhoneBook class. findContactBS() should go through your array in PhoneBook and return a Contact if it exists in the array and returns null if it is not in the array. findContactBS() should use the binary search algorithm.
    • Assuming your sort methods work, you should be able to test your binary search after sorting your PhoneBook.

    Due: Demonstrate the four methods in PhoneBook by the end of Tuesday (10/16)


    Wednesday (10/10)

    Agenda:

    • Demo BubbleSort to Mr. Bui
    • Linear Search Overview
    • Download LinearSearch
    • Fill in the commented parts of LinearSearch.java and demo a working linear search to Mr. Bui
    • Linear Search performance evaluation
      • What is the best case scenario? i.e. What is the minimum # of comparisons?
      • What is the worst case scenario? i.e. What is the maximum # of comparisons?
      • What is the average # of comparisons?
    • Can we do better than a linear search?
    • Introduction to Binary Search
      1. Assume sorted list
      2. Go to the middle point
      3. If the middle element matches the key, then the search is over
      4. If the key is less than middle element, go to the left (down), else go to the right (up)
      5. Repeat steps 2-4 until the key is found or when the left and right bounds pass each other
    • Binary Search Demo
    • Binary Search Demo2
    • BinarySearch Example Code
    • Binary Search performance evaluation
      • What is the best case scenario? i.e. What is the minimum # of comparisons?
      • What is the worst case scenario? i.e. What is the maximum # of comparisons?
      • What is the average # of comparisons?
    • Binary Search Advantages & Disadvantages
    • Sorting & Searching Review
      • Selection Sort
      • Bubble Sort
      • Linear Search
      • Binary Search
    • Download BinarySearch.java and re-implement it so that it searches through an array of Strings instead. You will need to change the array and how it's sorted as well. You will want to use the String class's compareTo() method.


    Friday (10/5)

    Agenda:

    • Introduction to Bubble Sort
      1. Start at the bottom / end of the array
      2. Compare the two elements and swap them if the smaller number is on the bottom
      3. Move up one
      4. Repeat steps 1 through 3 until smallest number has "floated" to the top
      5. Start at the bottom again and repeat the above steps for the next smallest number. This time, the front / top of the list can be ignored because the smallest number is guaranteed to be there.
    • Bubble Sort Animation
    • Download BubbleSort
    • Fill in the commented parts of the BubbleSort.java file. Where there is a comment, you need to write code. Show Mr. Bui your code and demo it.
    • Linear Search Overview
    • Download LinearSearch
    • Fill in the commented parts of LinearSearch.java and demo a working linear search to Mr. Bui


    Wednesday (10/3)

    Agenda:


    Monday (10/1)

    Agenda:

    • Object Usage Review!
    • Good programming style - source code header
    • PhoneBook class
      • PhoneBook has three attributes:
        • a final (constant) integer named MAX_SIZE that stores the maximum size of the phone book:
          public static final int MAX_SIZE = 100;
        • a private integer that stores the current size of the phone book, which is initialized to 0 (zero)
        • a private reference variable to a Contact array
      • The default constructor should initialize the reference variable to a new Contact array to MAX_SIZE, but in this case you should NOT make each element reference a new Contact. We will make the references point to new Contacts in the addContact() method. The current size of the phone book should also be initialized to zero.
      • The specific constructor takes two parameters: one int parameter named newSize and the other parameter is a Contact array.
        • Assign your private size attribute the value of the newSize parameter.
        • Set your private array reference to the second parameter of the constructor, which is also a Contact array reference.
      • Create the accessor method for the private Contact array attribute
      • You do NOT want to make mutator methods for array or its size because the array changes only when we add Contacts
      • Create a method named addContact(Contact newContact) that takes one Contact parameter and returns a boolean.
        • First check if the current size has reached the MAX_SIZE of the array. If the MAX_SIZE has been reached, then return false
        • Assuming that your size attribute stores the current size of the phone book, add the newContact to the Contact array at index size. HINT: Initially, your phone book is empty and the size is 0, so if you add a new Contact, you will be referencing it at index 0 (zero), which just happens to be the size attribute. Your size attribute is be the size attribute. Your size attribute is the index where you need to add the Contact.
        • Don't forget to increment the size attribute.
        • Return boolean true after you increment the size attribute
      • Create a method named size() that returns the size of the PhoneBook
      • Create a method named print() that prints the entire PhoneBook. The easiest way to do this is to loop through the Contact array using the size attribute as the upper-bound.
    • Test your PhoneBook class by creating a main method that creates a new PhoneBook and adds several Contacts and then prints out the entire phone book
    • When you are done testing the PhoneBook class, demo your test main() to Mr. Bui

    Due: Printed copy of PhoneBook.java by the end of today (10/1)


    Tuesday (9/25) - Thursday (9/27)

    Agenda:

    • Demo your Car class by using your CarTest main() method
    • Contact Assignment
      • Create the Contact class
      • Contact has three private String attributes: firstname, lastname, and phone
      • Create default and specific constructors
      • Create the public mutators and accessors
      • Create a method named toString() that takes zero parameters. toString() should return a String version of the object. For example: toString() should return something that says "John Doe - 703.867.5309"
      • Create a separate class named ContactMain that contains a single main() method
      • Your program should prompt the user asking them how many contacts they wish to add. (JavaIOExample.java)
      • Create a new Contact array using the size specified by the user. (MyFirstArrayProgram.java)
      • Loop through the array and prompt the user for information to create new contacts for the array. Don't forget that the array is initially just an array of null references! You need to explicitly point the references to new Contacts.

        for (int i = 0; i < myContacts.length; i++)
        {
            myContacts[i] = new Contact();
        }

        The easiest thing to do would be to use the specific constructor after you have prompted the user for information.
      • Lastly, create a loop that iterates through the array and prints out each Contact. Since we defined a toString() method in the class, we can simply say something like: System.out.println(contactArray[i]);
      • Print out both Contact and ContactMain and place them on Mr. Bui's desk

    Due: Printed copies of Contact.java and ContactMain.java by the end of Thursday (9/27)


    Friday (9/22)

    Agenda:

    • Demo your Person class by using your PersonTest main() method
    • Create a Car class
      Attributes:
      • color
      • year
      • make
      • model
      • current speed
      • current gear
      Methods
      • setters (mutators)
      • getters (accessors)
      • String toString()
      • void park() - sets the current speed to 0 and the current gear to "P"
      • void drive(int newSpeed) - sets the current gear to "D" and changes the current speed to the newSpeed
    • Create a CarTest class with a main() method that shows you testing your Car class


    Wednesday (9/19)

    Agenda:

    • JEDIT...yaye!
    • Person class
      Attributes:
      • first name
      • last name
      • birthdate
      • id number
      • height
      • weight
      • hair color
      • eye color
      Methods
      • Create a default constructor
      • Create a specific constructor
      • Create all the setters (mutators) for the listed attributes
      • Create all the getters (accessors) for the listed attributes
    • Create another file named PersonTest.java which contains only a main() method. Create an instance a person using the default constructor. Print out all the attributes using the getter methods. Change the attributes to different values by using the setter methods. Print out the attributes again.


    Monday (9/17)

    Agenda:

    • Work on dossier - Analysis of the Problem


    Thursday (9/13)

    Agenda:

    • Mr. Bui will call people up randomly to discuss their problem statement. While he meets with people, you should be working on your analysis of the problem. Use the resources found in the "Dossier" section of this website.
    • Work on dossier - Analysis of the Problem

    Due: Turn in your problem analysis rough draft at the end of today


    Friday (9/7) - Tuesday (9/11)

    Agenda:

    • Hand in summer assignment corrections
    • Dossier - Analysis of the Problem

    Due: Signed syllabus by today

    Due: Two to three sentence description of your problem.


    Wednesday (9/5)

    Agenda:

    • Hand in summer assignment corrections
    • Finish going over syllabus
    • Other logistical items
      • 20-10 no pass policy
      • Sign out sheet
    • Name cards
    • Complete the following survey
    • Share.
    • Login to eimacs and check where you are. You SHOULD have completed Test 12. If you have not done so, then complete all tests up through Test 12
    • Java review using eimacs
    • Java functions/methods
    • Java objects

    Due: Signed syllabus by Friday (9/7)


    Tuesday (9/4/07)

    Agenda:

    • Introductions
    • Go over syllabus
    • Questions?

    Due: Signed syllabus by Friday (9/7)