Schedule

Wednesday (6/13/07)

Agenda:

  • Turn in textbooks
  • Sign yearbooks
  • Resume Workshop


Tuesday (6/12/07)

Agenda:

  • Turn in textbooks
  • Grade Cryptography Quizzes
  • Sign yearbooks
  • Discuss life and potential majors in college


Monday (6/11/07)

Agenda:

  • Cryptography Quiz
  • Introduction to Authentication


Thursday (6/7/07)

Agenda:

  • Check updated grades
  • Turn in any missing work
  • Study for Cryptography Quiz on Monday

Due: Cryptography Quiz on Monday


Wednesday (6/6/07)

Warmup:

  • Find a partner and take out one sheet of paper.
  • Alice (A) wants to secretly send a large amount of data to Bob (B), which means that they both need to share a secret symmetric key. Assume that Alice and Bob possess each other's public keys. Write out the protocol for Alice (A) and Bob (B) to negotiate a secure communications channel

Agenda:

  • Quiz Review
    • Classical methods
      • caeser shift cipher
    • Symmetric key cryptography
      • XOR
      • substitution box
      • permutation box
      • advantages, disadvantages
      • brute force word problem
    • Asymmetric key cryptography
      • advantages, disadvantages
      • protocol word problem
  • Introduction to Authentication

Due: Cryptography Quiz on Monday


Tuesday (6/5/07)

Warmup:

  • What are the advantages and disadvantages of symmetric key and asymmetric key cryptography?

Agenda:

Due: Cryptography Quiz on Monday


Monday (6/4/07)

Agenda:

Due: Cryptography Quiz on Monday


Tuesday (5/29/07) - Thursday (5/31/07)

Agenda:


Friday (5/25/07)

Agenda:

  • Numb3rs
  • Work on Vernam ciphertexts. The key is "generals"
  • Decrypt your assigned ciphertext by next Tuesday/Thursday
  • Vernam Cipher Problems


Thursday (5/24/07)

Agenda:

  • Vernam (XOR) Cipher Review
  • Assign Vernam ciphertexts. The key is "generals"
  • Decrypt your assigned ciphertext by next Tuesday/Thursday
  • Vernam Cipher Problems


Tuesday (5/22/07) - Wednesday (5/23/07)

Agenda:


Thursday (5/17/07) - Monday (5/21/07)

Agenda:

  • Sneakers


Wednesday (5/16/07)

Agenda:

  • What things/concepts/ideas come to mind when we hear of "security"?
  • Introduction to Computer Security (Information Assurance)


Monday (5/14/07) - Tuesday (5/15/07)

Agenda:

  • Finish Tron


Thursday (5/10/07) - Friday (5/11/07)

Agenda:

  • Introduction to Cinematic Computer Graphics


Monday (5/7/07) - Wednesday (5/9/07)

Agenda:

  • Last minute questions
  • Good luck on the exam


Thursday (5/3/07) - Friday (5/4/07)

Agenda:

  • Review Boolean Logic & Digital Circuits


Wednesday (5/2/07)

Agenda:

  • Topic 7: File Organization


Tuesday (5/1/07)

Agenda:

  • Topic 6: Further System Fundamentals

Due: Read pages 354-372 of the textbook for tomorrow


Monday (4/30/07)

Agenda:

Due: Read pages 330-352 of the textbook for tomorrow


Friday (4/27/07)

Agenda:

  • Sample IB Exam - Paper 2
  • Binary Quiz on Monday (includes real numbers) - Topics 3.5.1-5, 4.1

Due: Quiz on all binary on Monday! (includes Real Numbers!)


Wednesday (4/25/07) - Thursday (4/26/07)

Agenda:

  • Finished Sample IB Exam homework check
  • Real Numbers Review
  • Binary Quiz on Monday (includes real numbers) - Topics 3.5.1-5, 4.1

Due: Quiz on all binary on Monday! (includes Real Numbers!)


Tuesday (4/24/07)

Agenda:

  • Slides homework check
  • Topic 3 Quiz
  • Finish Sample IB Exam (May 2004) by tomorrow. Skip questions that you have no clue about. Do not be lazy and skip all the questions...at least try to answer some of them.

Due: Go through the rest of the sample IB exam by yourself for tomorrow.


Monday (4/23/07)

Agenda:

  • Slides homework check
  • Sample IB Exam (May 2004)
  • Quiz tomorrow - Topics 3.1, 3.2, 3.5.6-8, 3.6, 3.7 (first 3 and last 3 slides of Topic 3)

Due: All slides printed and organized due today

Quiz on tomorrow! (first 3 and last 3 slides of Topic 3)


Friday (4/20/07)

Agenda:

  • Networking Quiz
  • Homework for Monday - Show Mr. Bui that you have printed out all the slides (AS HANDOUTS!) and organized them in some fashion
  • Quiz on Tuesday - Topics 3.1, 3.2, 3.5.6-8, 3.6, 3.7 (first 3 and last 3 slides of Topic 3)

Due: All slides printed and organized due Monday (3/23)

Quiz on Tuesday! (first 3 and last 3 slides of Topic 3)


Thursday (4/19/07)

Agenda:

  • Return quizzes
  • Quiz review

Networking Quiz tomorrow! Study slides!


Monday (4/16/07) - Wednesday (4/18/07)

Agenda:


Friday - 4/13/07

Agenda:

Software Development & Case Study quiz on Monday (4/16)


Thursday - 4/12/07

Agenda:

  • Introduction to Software Development


Wednesday - 4/11/07

Agenda:

  • Case Study Quiz -- take out a sheet of paper and put your name on it
  • Case Study Discussion
  • Case Study Worksheet
  • Dossier party?
  • Review dates


Tuesday - 4/10/07

Agenda:

  • Welcome back.
  • Return dossiers
  • 3rd quarter grades
  • IB Exam Cram
  • IBCS course curriculum handout
  • Case study handout -- read for tomorrow (there will be an open-book reading quiz)

Due: Read case study handout by tomorrow (4/11)


Dossier Deadlines

Check the updated BinaryTree code and its test file. delete() was added!.

Here's an example of how to create a basic menu interface.

Read and write to files using the RandomAccessFile class. Here's an example of how to use it.

Monday Tuesday Wednesday Thursday Friday Saturday
19 20 21 22 23 24
B1: Data Structures B2: Algorithms B3: Modular Design   C2: Usability Help Session
Mr. Bui's room
9AM - 3PM
26 27 28 29 30 31
C3: Handling Errors
C4: Success of Program
D1: Test Output
D2: Conclusion D3: User Manual   Final Draft
with
all sections
and
appendices
 


Friday - 3/16/07

Agenda:

  • COMPLETE DOSSIER DUE FRIDAY 3/30
  • NO LATE SUBMISSIONS FOR FINAL DRAFT
  • No more warmups until April
  • Upcoming dossier deadlines
  • Graded sections will be available the next day
  • KEEP YOUR ROUGH DRAFTS AND TURN IN WITH FINAL DRAFT
  • Saturday Help Sessions - tomorrow & next Sat. from 9AM to 3PM

Due: "Data Structures" section of dossier due Monday (3/19)

Due: "Algorithms" section of dossier due Tuesday (3/20)


Thursday - 3/15/07

Warmup:

  • Write the complete boolean expression for the truth table on the board
  • Simplify the expression
  • Draw the logic circuit for the simplified expression

Agenda:

  • Work on "Data Structures" section of your dossier

Due: "Data Structures" section of dossier due Monday (3/19)

Due: "Algorithms" section of dossier due Tuesday (3/20)


Wednesday - 3/14/07

Agenda:

  • Dossier Criterian B1 - Data Structures
  • Dossier Criterian B2 - Algorithms
  • Work on "Data Structures" section of your dossier

Due: "Data Structures" section of dossier due Monday (3/19)

Due: "Algorithms" section of dossier due Tuesday (3/20)


Tuesday - 3/13/07

Agenda:

  • Make sure you have a hard copy of your Big O assignment from yesterday. If you do not, then print it out
  • Go over Big O complexities of each data structure


Monday - 3/12/07

Agenda:

  • Mr. Bui will be checking for this assignment tomorrow
  • Listed below are the various data structures that we have created and used. Your assignment is to derive and explain the Big O complexities for each of the following data structures' operations:
    • Linked List
      • add()
      • remove()
      • isEmpty()
      • insertInOrder()
      • print()
    • Stack
      • print()
      • push()
      • pop()
      • top()
      • isEmpty()
    • Queue
      • print()
      • add()
      • remove()
      • isEmpty()
    • Binary Tree
      • print
      • insert()

Due: Big O - Data Structures responses due tomorrow


Friday - 3/9/07

Agenda:

  • Work on your dossier


Thursday - 3/8/07

Agenda:

  • Demo your tree to Mr. Bui if you have not already
  • Big O Review
  • Big O Exercises


Wednesday - 3/7/07

Warmup:

  • Define the following terms: object, class, information hiding, and encapsulation

Agenda:

  • Demo your tree to Mr. Bui
  • Algorithm Evaluation


Tuesday - 3/6/07

Warmup:

  • A network administrator wishes to backup his/her server using magnetic tapes. What are the advantages and disadvantages of using tape compared to hard disks?

Agenda:

  • Work on your tree! It's due today!

Due: Your dossier's tree or ContactTree due today!


Monday - 3/5/07

Warmup:

  • Explain the differences between a syntax error, semantic error, and run-time error.

Agenda:

  • Work on your tree! It's due tomorrow

Due: Your dossier's tree or ContactTree due tomorrow!


Friday - 3/2/07

Warmup:

  • List five functions of a file manager
  • Describe and give an example of lossy compression
  • Describe and give an example of loss-less compression

Agenda:

  • You have TWO options! You may either implement a binary tree for your dossier OR you may implement a binary tree using Contact as described below.
  • ContactTree will be a binary tree that uses our ol' Contact class. You will need to do the following:
    • Create a new class called ContactTreeNode, which should contain three attributes: references to a Contact and two ContactTreeNodes (left and right!)
    • Create a new class called ContactTree, which will essentially be a binary tree that stores Contacts. You may use BinaryTree.java, but be sure to rename it ContactTree.java AND to make the appropriate changes inside of it. HINT: If you forgot how to compare strings, check out CompareToDemo2.java
    • Create a main() method that tests your ContactTree. You should create five to ten ContactTreeNodes and insert them all into a ContactTree. After that, use the ContactTree's print() method to verify your results.

Due: Your dossier's tree or ContactTree due next Tuesday (3/6)


Thursday - 3/1/07

Warmup:

  • Take out your assignment from yesterday
  • Get checked off that you did it

Agenda:


Wednesday - 2/28/07

Agenda:

  • Mr. Bui WILL be collecting this assignment tomorrow (Thursday). You may hand-write or type your responses. Feel free to use the lecture slides, textbook, and/or internet. If you do not finish in class, then you must finish the assignment at home.

    1. Describe the purpose and/or function of the ALU.
    2. List and describe each step of the fetch-execute cycle
    3. Order the following storage hardwares from slowest to fastest: flash, register, tape, cache, disk
    4. Convert the following binary to hexadecimal (show your work): 11111110111011011111000000001101
    5. Assuming that you are limited to 8 bits, what is the 2's complement binary number for -123? Show your work.
    6. You are working for Adobe and developing a colorscheme that has 867 different colors. How many bits do you need to represent every color? Why?
    7. You are asked to model/simulate the cafeteria lunch lines. What abstract data type(s) would you use and why?
    8. Assume you are given a HUGE list of names, which are organized alphabetically. If you wanted to search/find somebody's name on that list, which search would you use and why?

  • Work on your Dossier


Tuesday - 2/27/07

Warmup:

  • Using Java, implement the recursive function that prints out the fibonacci sequence

Agenda:

  • Show Mr. Bui your BinaryTreeNode
  • Dossier checkpoint #2
  • BinaryTree class
    • void print() review
    • BinaryTreeNode find(int num)
    • void insert(int num)


Monday - 2/26/07

Warmup:

Take out a sheet of paper and describe the following words in the context of binary trees:

  • root
  • parent
  • left-child
  • right-child
  • leaf
  • subtree

Agenda:

  • Show Mr. Bui your BinaryTreeNode
  • Dossier checkpoint #2
  • Binary trees review
  • BinaryTree class
    • Create a new class named BinaryTree
    • Use the BinaryTreeNode in your BinaryTree class (what should its default value be?)
    • Implement the default constructor: BinaryTree()
    • As a class, we will create the print() method


Friday - 2/23/07

Agenda:

  • Complete DynamicQueue and the test main() for it and e-mail BOTH to Mr. Bui
  • Implement the recursive functions factorial() and fibonacci() in Java and test them out! HINT: You are welcome to use the lecture slides from yesterday as a guide.
  • Review the lecture slides on Binary Trees
  • Create a new class called BinaryTreeNode
    • Your BinaryTreeNode should have three attributes: an int and two BinaryTreeNode references (name them appropriately)
    • Don't forget to give all three attributes default values
    • You should also create a default constructor for BinaryTreeNode
  • Mr. Bui WILL be checking for BinaryTreeNode on Monday.
  • Work on your Dossier!
  • Dossier checkpoint next Monday. You should be able to show me that you've been working on your dossier at home.

Due: Dossier progress update on Monday (2/26). You should be able to show progress on your dossier. Last minute updates will not count.


Thursday - 2/22/07

Warmup:

  • State what type of search would always be used on unsorted data and explain why

Agenda:

  • Mr. Bui's DynamicStack.java
  • Demo DynamicQueue using YOUR tests.
  • Introduction to Recursion
  • Implement factorial() and fibonacci() in Java and test them out!
  • Work on your Dossier!
  • Dossier checkpoint next Monday. You should be able to show me that you've been working on your dossier at home.

Due: DynamicQueue due today

Due: Dossier progress update on Monday (2/26). You should be able to show progress on your dossier. Last minute updates will not count.


Wednesday - 2/21/07

Warmup:

  • State which data type is best for storing a telephone number (e.g. 01623 440325) and give two reasons why.

Agenda:

  • Work on DynamicQueue. You should e-mail it yourself so you can work on it at home because you will not have much class time tomorrow to work on it.
  • After you have completed DynamicQueue, you should test all of the methods appropriately. You MUST create your own test main() and show that to me as well
  • Work on your Dossier!
  • Dossier checkpoint next Monday. You should be able to show me that you've been working on your dossier at home.

Due: DynamicQueue due tomorrow (2/22)

Due: Dossier progress update on Monday (2/26). You should be able to show progress on your dossier. Last minute updates will not count.


Tuesday - 2/20/07

Warmup:

  • Write the skeleton class definition for DynamicQueue. It should contain the following:
    • two Node attributes (name them appropriately!)
    • default constructor: DynamicQueue()
    • void add()
    • int remove()
    • int getHead()
    • int getTail()
    • boolean isEmpty()
    • void print()
  • Make sure that your skeleton code compiles!

Agenda:

  • Demo DynamicStack using Mr. Bui's surprise main
  • DynamicQueue explanations and illustrations
  • Work on DynamicQueue. You should e-mail it yourself so you can work on it at home because you will not have much class time tomorrow to work on it.
  • Dossier checkpoint next Monday. You should be able to show me that you've been working on your dossier at home.

Due: DynamicQueue due Thursday (2/22)

Due: Dossier progress update on Monday (2/26). You should be able to show progress on your dossier. Last minute updates will not count.


Friday - 2/16/07

Agenda:

Due: DynamicStack due today!


Thursday - 2/15/07

Agenda:

  • Complete DynamicStack
  • At the beginning of class tomorrow, you must be able to demo your DynamicStack to Mr. Bui using his given main method and a surprise one too

Due: DynamicStack due tomorrow!


Tuesday - 2/13/07

Agenda:

  • Dossier Progress Check
  • Dynamic Stacks - Using the Node class, implement your own stack class called DynamicStack.
  • I will be checking for the following class methods:
    • DynamicStack() - default constructor
    • void push(int num) - push a number onto the stack
    • int pop() - pop the stack and return the pop's value
    • int top() - just return the top's value
    • boolean isEmpty() - returns true if the stack is empty, and false otherwise
    • void print() - print out the contents off the stack
    • You can test your DynamicStack using DynamicStackTest.java
  • Work on Dossier code
    • Class definition for the basic object that you will be using in your dossier
    • You should create all the necessary accessers and mutators for all of the attributes
    • Don't forget to comment your code

Due: Dossier Check - Basic class definition due today

Due: DynamicStack due tomorrow


Monday - 2/12/07

Agenda:

  • LinkedList class
  • LinkedListTest class - LOOK OVER THIS CODE!
  • Dynamic Stacks - Using the Node class, implement your own stack class called DynamicStack.
  • I will be checking for the following class methods:
    • DynamicStack() - default constructor
    • void push(int num) - push a number onto the stack
    • int pop() - pop the stack and return the pop's value
    • int top() - just return the top's value
    • boolean isEmpty() - returns true if the stack is empty, and false otherwise
    • void print() - print out the contents off the stack
    • You can test your DynamicStack using DynamicStackTest.java
  • Work on Dossier code
    • Class definition for the basic object that you will be using in your dossier
    • You should create all the necessary accessers and mutators for all of the attributes
    • Don't forget to comment your code

Due: Dossier Check - Basic class definition due tomorrow

Due: DynamicStack due Wednesday(2/14/07)


Friday - 2/9/07

Warmup:

  • List the five different scenarios when removing a node from a LinkedList

Agenda:

  • LinkedLists
    • boolean isEmpty()
    • void insert(int newNum)
  • Work on Dossier code

Due: Dossier Check - Basic Class Definitions due Tuesday (2/13/07)


Thursday - 2/8/07

Warmup:

  • Draw the logic circuit for the boolean expression on the board

Agenda:

  • Return "Criteria for Success" Evaluation
  • Begin coding the basic information object for your Dossier

Due: Dossier Check - Basic Class Definitions due Tuesday (2/13/07)


Wednesday - 2/7/07

Agenda:

  • "Prototype solution" Evaluation
    • Take out 2-3 sheets of paper
    • Find a partner (who has also brought in their prototype)
    • You have 5-10 minutes to take turns evaluating each other's prototypes. Positive and negative comments MUST be written down.
    • Find another partner and take 5-10 more minutes to evaluate each other's prototypes.

Due: "Prototype solution" due today


Tuesday - 2/6/07

Warmup:

  • Simplify the following boolean expression:

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

Agenda:

  • Introduction to LinkedLists
    • Empty linked lists
    • Adding to linked lists
    • Removing from linked lists
  • "Prototype solution" Evaluation
    • Take out 2-3 sheets of paper
    • Find a partner (who has also brought in their prototype)
    • You have 5-10 minutes to take turns evaluating each other's prototypes. Positive and negative comments MUST be written down.
    • Find another partner and take 5-10 more minutes to evaluate each other's prototypes.

Due: "Prototype solution" due today


Monday - 2/5/07

Warmup:

  • What is the output from the following code?

    int a = 1, b = 2, c = 3;
    a += b + c
    b += a + c
    c += a + b
    System.out.println(a + " " + b + " " + c);

Agenda:

  • Quiz on NodeFun.java
  • Demo CircularQueue to Mr. Bui
  • Introduction to LinkedLists
  • Work on "Prototype solution"

Due: "Prototype solution" due tomorrow


Friday - 2/2/07

Warmup:

  • 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]));
    }

Agenda:

  • Object and References Review
  • Node class
  • Print out CircularQueue.java and hand it in to Mr. Bui
  • Once you have completed the CircularQueue implementation, you should work on your Dossier's solution prototype

Due: CircularQueue due today

Due: "Prototype solution" due next Tuesday (2/6/07)


Thursday - 2/1/07

Warmup:

  • 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?

Agenda:

  • Parameter Passing
  • Circular Queues
    • Using Mr. Bui's Queue class, 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
  • Once you have completed the CircularQueue implementation, you should work on your Dossier's solution prototype

Due: CircularQueue due tomorrow

Due: "Prototype solution" due next Tuesday (2/6/07)


Wednesday - 1/31/07

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:

  • Data Structures vs. Abstract Data Types (ADT)
  • Circular Queues
    • Using Mr. Bui's Queue class, 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
  • Once you have completed the CircularQueue implementation, you should work on your Dossier's solution prototype

Due: CircularQueue due this Friday

Due: "Prototype solution" due next Tuesday (2/6/07)


Tuesday - 1/30/07

Agenda:

  • Collect "Criteria for Success"
  • Dossier - "Prototype Solution"
  • Introduction to Binary Trees
  • Circular Queues
    • Using Mr. Bui's Queue class, 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

Due: CircularQueue due this Friday

Due: "Prototype solution" due next Tuesday (2/6/07)


Monday - 1/29/07

Warmup:

  • How would you implement a queue using just two stacks.

Agenda:

  • Return "Analysis of the Problem"
  • Data Structures Review - Stacks & Queues
  • Circular Queues
    • Using Mr. Bui's Queue class, 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

Due: "Criteria for Success" due tomorrow


Thursday - 1/25/07

Agenda:

Due: "Criteria for Success" due Tuesday (1/30/07)


Wednesday - 1/24/07

Warmup:

  • Implement a stack that can store Strings. You may use Mr. Bui's Stack.java
  • Be sure to test your stack out. You may use Mr. Bui's StackMain.java. You do not need to take in input, just throw in your own test strings into the code.

Agenda:

  • More about Stacks - The Stack Frame

Due: "Criteria for Success" due Tuesday (1/30/07)


Tuesday - 1/23/07

Agenda:

Due: "Criteria for Success" due Tuesday (1/30/07)


Friday - 1/19/07

Agenda:

  • Real Binary Numbers / Floating-point Numbers
  • Work on Dossier - Analysis of the Problem

Due: "Problem Analysis" Rough Draft due Monday (1/22/07)


Thursday - 1/18/07

Agenda:

  • Utility Software
  • Work on Dossier - Analysis of the Problem

Due: "Problem Analysis" Rough Draft due Monday (1/22/07)


Wednesday - 1/17/07

Agenda:

  • Dossier - Analysis of the Problem
  • Errors

Due: "Problem Analysis" Rough Draft due Monday (1/22/07)


Tuesday - 1/16/07

Agenda:

  • Return Number Systems Test
  • Building Digital Circuits
  • Adders


Friday - 1/12/07

Agenda:

  • Number Systems Test!


Thursday - 1/11/07

Agenda:

  • Test Review
    • Number Systems
    • Binary <-> Decimal
    • Hexadecimal <-> Binary
    • Hexadecimal <-> Decimal
    • Adding Binary Numbers (all positive)
    • Negative Binary - Sign Magnitude
    • Negative Binary - 2's Complement
    • 2's Complement Addition/Subtraction
    • Min/Max Values - Positive & 2's Complement
    • Data Representation - # bits necessary given # of symbols needed
  • DeMorgan's Law
  • Digital Logic

Close-book test on Binary this Friday! Study using the slides!


Wednesday - 1/10/07

Warmup:

  • Given that the tildae can also be used as the NOT operator (e.g., NOT(A) = ~A)
  • Write out the truth table for AB + ~(AB) + ~AB

Agenda:

  • New Slides link - lectures posted on-line
  • Boolean Expressions
  • Boolean Practice

Close-book test on Binary this Friday! Study using the slides!


Tuesday - 1/9/07

Warmup:

  • As a programmer you are asked to determine the size of a file. The file is to contain text data that is collected from an external source. The data for the file will be transmitted once per day for a period of 3 hours over a data line that transmits at a rate of 100,500 bps.
  • Calculate the daily size of the file and use appropriate prefixes
  • It is required that the file be stored online for a period of two years and that a duplicate will also need to be kept. Estimate the size of the data at the end of the two year period, assuming that no data is stored at the start of operation

Agenda:

  • Ch. 3 Homework
  • Boolean Logic
  • Boolean Expressions

Monday - 1/8/07

Warmup:

  • You are developing a video game system that needs to be able to process 4134 different colors. How many bits do you need to represent all the colors?
  • Assuming you have 8 bits to work with, what is the 2's Complement representation for -50?

Agenda:

  • Binary Homework
  • Underflow/Overflow
  • Analog vs. Digital
  • Boolean Logic

Due: Binary HW due today

Tuesday - 1/9/07

Warmup:

  • As a programmer you are asked to determine the size of a file. The file is to contain text data that is collected from an external source. The data for the file will be transmitted once per day for a period of 3 hours over a data line that transmits at a rate of 100,500 bps.
  • Calculate the daily size of the file and use appropriate prefixes
  • It is required that the file be stored online for a period of two years and that a duplicate will also need to be kept. Estimate the size of the data at the end of the two year period, assuming that no data is stored at the start of operation

Agenda:

  • Binary Homework
  • Boolean Logic
  • Boolean Expressions


Friday - 1/5/07

Warmup:

  • Assuming only positive binary numbers, 00101001 + 0001110 = ?
  • Assuming only positive binary numbers, 11010011 + 0011010 = ?

Agenda:

  • Negative Binary Numbers - 2's Complement
  • Subtraction!

Due: Binary HW due Monday (1/8/07)


Thursday - 1/4/07

Warmup:

  • Convert 1A2B3C4D from hexadecimal to decimal
  • Convert 203443 from decimal to hexadecimal

Agenda:

  • Adding Binary Numbers
  • Negative Binary Numbers - Sign Magnitude

Wednesday - 1/3/07

Warmup:

  • Convert 00110110 from binary to decimal
  • Convert 10100010 from binary to decimal
  • Convert 143 from decimal to binary
  • Convert 89 from decimal to binary

Agenda:

  • Data Representation Review
  • Hexadecimal

Tuesday - 1/2/07

Agenda:

  • Turn in homework
  • Binary->Decimal Review
  • Decimal->Binary Review
  • Data Representation
  • Hexadecimal

Thursday - 12/21/06

Agenda:

  • Finish Introduction to Computer Architecture
  • Introduction to Binary
  • Textbook Homework:
    • Exercise 3.3 #1,3
    • Exercise 3.4 #5,8,9
    • Exercise 3.5 #2,6,7

Due: Textbook problems due 1/2/06


Wednesday - 12/20/06

Agenda:

  • Finish Introduction to Computer Architecture
  • Introduction to Binary

Tuesday - 12/19/06

Agenda:

  • Review High-level vs. Low-level Languages
  • Introduction to Computer Architecture

Monday - 12/18/06

Agenda:

  • Demo findContactLS() and findContactBS()
  • Review High-level vs. Low-level Languages
  • Introduction to Computer Architecture

Friday - 12/15/06

Agenda:

  • Complete bubbleSort() and selectionSort()
  • Demo bubbleSort() and selectionSort() using your own tests
  • Complete & demo findContactLS() and findContactBS()

Due: AddressBook findContactLS() and findContactBS() are due today!

Due: Read pages 130-150 of the textbook


Thursday - 12/14/06

Agenda:

  • Complete bubbleSort() and selectionSort()
  • Demo bubbleSort() and selectionSort() using your own tests
  • Complete findContactLS() and findContactBS()
    • Assume that all lastnames and firstnames are unique (no two people share the same lastname or firstname).
    • If you sort by firstname, then you should search by firstname. If you sort by lastname, then you should search by lastname

Due: AddressBook bubbleSort() and selectionSort() are due today!

Due: AddressBook findContactLS() and findContactBS() are due tomorrow!


Wednesday - 12/13/06

Agenda:

  • Method Review
    • What is a method?
    • Why do we use methods?
    • What are the important parts or characteristics of a method?
  • Mr. Bui's AddressBook with ArrayList
  • ArrayList's set() method
  • ArrayListSetMethodDemo
  • Work on adding bubbleSort() and selectionSort() to AddressBook
  • Do not print out your code, you will be demoing the two methods to Mr. Bui, so be sure to test out to see if both sorts are working correctly.
  • Implement findContactLS() and findContactBS() in AddressBook. Descriptions of these methods can be found below.

Due: AddressBook bubbleSort() and selectionSort() are due tomorrow!

Due: AddressBook findContactLS() and findContactBS() are due Friday!


Tuesday - 12/12/06

Agenda:

  • Insertion into an array or list
  • Demo StringBinarySearch to Mr. Bui
  • Add bubbleSort() and selectionSort() methods to any version of the AddressBook class (array or ArrayList).
    • In order to change (set) a specific element in an ArrayList, you will need to use the set() method found here
  • Implement findContactLS(String fn, String ln) using any version of your AddressBook. findContactLS() should use linear search to return the specified Contact. If the Contact is not in your AddressBook, then you should return null
  • Implement findContactBS(String fn, String ln) using any version of your AddressBook. findContactBS() should use binary search to return the specified Contact. If the Contact is not in your AddressBook, then you should return null. You may assume that the

Due: Complete the StringBinarySearch by today

Due: AddressBook bubbleSort() and selectionSort() are due Thursday!

Due: AddressBook findContactLS() and findContactBS() are due Friday!


Monday - 12/11/06

Agenda:

  • Sorting & Searching Review
  • 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()
  • Add bubbleSort() and selectionSort() methods to any version of the AddressBook class (array or ArrayList).
    • In order to change (set) a specific element in an ArrayList, you will need to use the set() method found here
  • Implement findContactLS(String fn, String ln) using any version of your AddressBook. findContactLS() should use linear search to return the specified Contact. If the Contact is not in your AddressBook, then you should return null
  • Implement findContactBS(String fn, String ln) using any version of your AddressBook. findContactBS() should use binary search to return the specified Contact. If the Contact is not in your AddressBook, then you should return null. You may assume that the

Due: Complete the StringBinarySearch by tomorrow. Be ready to demo it to Mr. Bui


Friday - 12/8/06

Agenda:

Due: Complete the StringBinarySearch by next Tuesday.


Thursday - 12/7/06

Agenda:

  • Print out your AddressBook that uses ArrayList and place it on Mr. Bui's desk.
  • Add bubbleSort() and selectionSort() methods to Mr. Bui's or your AddressBook class, which should now be using the ArrayList data structure. HINT: In order to compare Strings, you will need to learn how to use the compareTo() method found here. In order to change a specific element in an ArrayList, you will need to use the set() method found here
  • If done, then read pages 116-118 of the textbook.
  • Assuming that your AddressBook is sorted, implement a binary search version of getPhoneNum() called getPhoneNumBS()

Due: AddressBook with ArrayList is due today


Wednesday - 12/6/06

Agenda:

  • Convert Mr. Bui's AddressBook so that it uses ArrayList instead of arrays
  • Add bubbleSort() and selectionSort() methods to Mr. Bui's or your AddressBook class, which should now be using the ArrayList data structure. HINT: In order to compare Strings, you will need to learn how to use the compareTo() method found here. In order to change a specific element in an ArrayList, you will need to use the set() method found here
  • If done, then read pages 116-118 of the textbook.
  • Assuming that your AddressBook is sorted, implement a binary search version of getPhoneNum() called getPhoneNumBS()

Due: AddressBook with ArrayList is due tomorrow


Tuesday - 12/5/06

Agenda:

  • Introduction to ArrayList
  • ArrayListIntro.java
  • Using ArrayList with our Contact class
  • ArrayList Exercise
    • Write a program that constantly adds integers to an ArrayList until the user inputs -1
    • Output the min, max, mean, and median of the ArrayList
  • Convert Mr. Bui's AddressBook so that it uses ArrayList instead of arrays

Due: AddressBook with ArrayList is due Thursday


Monday - 12/4/06

Warmup:

  • Write a Java program that prompts the user for three decimal numbers
  • Print out the largest of the three numbers

Agenda:

  • Get papers back
  • Demo BubbleSort to Mr. Bui if you have not already.
  • Mr. Bui's AddressBook solution


Friday - 12/1/06

Agenda:

  • Demo SelectionSort to Mr. Bui if you have not already.
  • 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
  • Another 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.

Due: BubbleSort demo is due Monday


Thursday - 11/30/06

Agenda:

  • Demo SelectionSort to Mr. Bui by the end of the day.
  • Research BubbleSort and create a new class like SelectionSort, but use the BubbleSort algorithm instead.

Due: SelectionSort is due today


Wednesday - 11/29/06

Agenda:

Due: SelectionSort is due tomorrow


Tuesday - 11/28/06

Agenda:

  • Finish Chapter 1 Exercise Discussion
  • Boolean review
  • Array review
  • Object usage
  • Class construction review
  • Read pages 119-122 of the textbook. Implement bubblesort and selection sort in your AddressBook. If you need more resources on the two different types of sort, then *ahem* google.


Monday - 11/27/06

Agenda:


Tuesday - 11/21/06

Agenda:

  • My solutions to the following assignments:
  • Explanation of deleteContact()
  • Take out a sheet of paper and number it from 1 to 6. Please answer the following 5 questions ANONYMOUSLY. Be honest!
    1. On average, how many hours per week outside of school do you spend on this class?
    2. What do you NOT like about this class?
    3. How would you improve this class? Please be constructive here.
    4. On a scale from 1 to 10, how well do you understand the material?
    5. What topic, if any, would you like me to review again? Please be specific. ("all of it" is NOT an informative answer)
    6. Please write down any other suggestions or concerns here
  • Complete AddressBook class
  • HOMEWORK!
    • Read Chapter 1 of your textbook
    • Write down words that you do not understand (you do not need to define them, and we'll discuss them in class)
    • Complete exercises: 1.2 #1,2; 1.4 #1
    • When writing your responses, you are encouraged to be CLEAR & CONCISE. (e.g., use bulleted lists instead of paragraphs

Due: Hardcopy of AddressBook should be turned in to Mr. Bui on Monday

Due: Chapter 1 due Monday


Monday - 11/20/06

Agenda:

  • Get checked off for testing your AddressBook with Mr. Bui's AddressBookTestMain
  • Implement the method deleteContact(String fn, String ln), which returns a boolean
    • Iterate through your Contact array, looking for the first contact that has the same firstname and lastname as the parameters
    • In order to delete the Contact, you will need to find it in the array and then shift all the Contacts after it down one index location
    • Let's assume you have found the Contact in the array and the location is foundIndex, you should then shift the next Contact (at foundIndex+1) over the Contact to be deleted
    • Continue on to the Contact at foundIndex+1 and shift foundIndex+2 over foundIndex+1
    • After you have completed all the shifting, you should assign the Contact reference at location size-1 to null AND decrement your size attribute by 1
  • Create a test main in another class that tests your delete method
  • Print out AddressBook and place it in the tray on Mr. Bui's desk after you have added deleteContact(). If you do not complete deleteContact() by tomorrow, then turn in what you have for partial credit.

Due: Hardcopy of AddressBook should be turned in to Mr. Bui by tomorrow


Friday - 11/17/06

Agenda:

  • Download the following files into the same directory as your AddressBook.java file:

    AddressBookTestMain.java
    input.txt

  • You can test your AddressBook class using Mr. Bui's AddressBookTestMain (even though you should have created your own too). You should see the following printed on your screen:

    Mr. Bui - 867-5309
    John Doe - 867-5309
    Steve Rogers - 111-1111
    Peter Parker - 222-2222

  • A new file named "output.txt" should have also been created that looks like the following:

    Mr.
    Bui
    867-5309
    John
    Doe
    867-5309
    Steve
    Rogers
    111-1111
    Peter
    Parker
    222-2222

  • Your readFromFile() method should be able to read any file that you have printed using printToFile().

Due: You will demo your AddressBook class to Mr. Bui using his AddressBookTestMain on Monday


Thursday - 11/16/06

Agenda:

  • Work on AddressBook and More AddressBook methods

Due: Completed AddressBook (with all the extra methods) due tomorrow


Wednesday - 11/15/06

Agenda:

  • Work on AddressBook
  • More AddressBook methods:
    • Create a method named printToFile(String filename) that returns nothing.
      • The method should print the Contact array out to file.
      • Be sure to print the Contacts out in such a format that can later be used as input.
      • You must also add the "throws IOException" after the close parameter parentheses, so your method definition would look something like this: public void printToFile(String filename) throws IOException
    • Create a method named readFromFile(String filename) that returns a boolean.
      • This method will read in Contacts from a file and return True if they are added successfully to the Contact array, and false otherwise.
      • You must first count the total number of lines in the file, which helps you determine the number of Contacts in the file.
      • Check to see if you have room in the Contact array for the new Contacts from the file. If you have room, then read in the Contacts from the file, add them to your Contact array (HINT: you could use addContact() here), and return true.
      • If you do not have room, then return false. You must also add the throws IOException for this method too.
    • Create a method named getPhoneNumber(String fn, String ln) that returns String. Search through your Contact array for the Contact with the specified firsname (fn) and lastname (ln) and return his/her phone number.

Due: AddressBook is due at the end of today, but do not turn it in. Instead, show me the test main that shows your class working.

Due: More AddressBook methods are due tomorrow.


Tuesday - 11/14/06

Agenda:

  • Check your final grades on-line
  • Mr. Bui's Contact class
  • AddressBook class
    • AddressBook has three private attributes:
      • a final (constant) integer named MAX_SIZE that stores the maximum size of the address book:
        public static final int MAX_SIZE = 99
      • an integer that stores the current size of the address book, which is initialized to 0 (zero)
      • a 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 address 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 address book, add the newContact to the Contact array at index size. HINT: Initially, your address 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 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 AddressBook
    • Create a method named print() that prints the entire AddressBook. The easiest way to do this is to loop through the Contact array using the size attribute as the upper-bound.
  • Test your AddressBook class by creating a main method that creates a new AddressBook and adds several Contacts and then prints out the entire address book

Due: AddressBook (with test output commented at the bottom) class due tomorrow


Thursday - 11/9/06

Agenda:

  • ContactUpdater Helpful Tips
    • Create one Contact array that stores the information read from the text file, and create another Contact array that stores the information that you add through the keyboard
    • You may either hardcode the size of the first Contact array (assuming you know how many Contacts are in the text file) OR you may count the number of Contacts in the text file first and then read in all their information
    • Output one array to file, and then output the other array
    • Make sure that when you output, you output the information in the same format as you read it in. E.g., The firstname, lastname, and phone should all be on separate lines. If you do not output in the same format, then your program will not be able to read the file properly as input.

Due: ContactUpdater due today


Wednesday - 11/8/06

Agenda:

  • FileOutputDemo
  • ContactUpdater
    • Create a class named ContactUpdater that only has a main method
    • Copy and paste your original ContactMain code, and add file output at the end of it so that you print to file your Contact information
    • Test to see if your file output works
    • Now add your ContactInput code to the beginning of ContactOutput
    • Tweak your program so that in the beginning, it loads Contacts from a file, then you should let the user add some Contacts, and finally, your program should output the Contacts back to the original file (overwriting the old data)
    • Your program should effectively let you continually update a Contacts file with more and more Contacts

Due: ContactInput due today

Due: ContactUpdater due tomorrow


Tuesday - 11/7/06

Agenda:

  • Object Usage Review 2
  • FileInputDemo
  • ContactInput
    • Create a class ContactInput that only has a main method
    • Copy and paste your ContactMain code to ContactInput
    • Modify the code in ContactInput so that instead of getting Contact information from the keyboard, you get it from a file
    • Don't forget that you will need to create the text file to read from!
  • When you are done, you can check out the FileOutputDemo

Due: Contact and ContactMain due at the end of today

Due: ContactInput due tomorrow


Monday - 11/6/06

Agenda:

  • Go over Quiz 3
  • Contact Assignment
    • Create the Contact class from Quiz 2
    • 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
    • Create a new Contact array using the size specified by the user
    • 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 references! You need to explicitly point the references to new contacts. The easiest thhing 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: Contact and ContactMain due at the end of tomorrow


Friday - 11/3/06

Agenda:

  • Quiz 3 : open-note (except other quizzes), open-computer, closed-person, and you only have 10 minutes!
  • Complete and TEST Blackjack. If you have already done both, then guide somebody else who has not finished OR do homework for another class OR do your college applications.


Thursday - 11/2/06

Agenda:

  • TESTING BLACKJACK
  • Copy and paste your test output into the text editor and save the testing results! When documenting your testing results, try to make it look professional.
  • Play a bunch of blackjack games until you have covered all the different testing cases.
    1. Player busts (dealer wins without drawing more cards)
    2. Dealer busts (player wins)
    3. Player and Dealer are both less than than 21 (whoever is closer to 21 wins)
    4. Player and dealer tie, which is a push (draw) and nobody wins. This case may be difficult to test, but you may rig the deck by specifying the Card values so that you always get a tie. E.g. The player and dealer are both dealt an Ace and a 7.
  • When done testing, find somebody who has not completed Blackjack and guide them through their problems.

QUIZ TOMORROW - The quiz will be similar to last week's quiz, but open-note and less time.


Wednesday - 11/1/06

Agenda:

  • WORK ON BLACKJACK

Due: Blackjack due at the end of today


Tuesday - 10/31/06

Agenda:

  • Return and go over Quiz 2
  • Work on Blackjack
  • BLACKJACK HINTS:
    • The ONLY method you really need in your Blackjack class is the main() method, which is the game itself
    • The first four cards dealt DO NOT have to be in a loop. You can create four Card reference variables like playerCard1 which should reference deck[0] or their appropriate card in the deck.
    • When the player is asked for more cards, we want to remember where in the deck we are, so that we can continually deal more and more cards. What do we use whenever we need to "remember" some information? We could try remembering the index of the next card to be dealt.
    • It may be helpful to place comments of steps or pseudocode in your main method

Due: Blackjack due at the end of tomorrow


Monday - 10/30/06

Agenda:

  • Review of Blackjack Rules. If you are still unfamiliar, go here
  • Blackjack Assignment
      Create a main method in a new class called Blackjack. In your main method, we will be creating the actual blackjack game. You will have to do the following:
    • Create the deck
    • Shuffle the deck
    • You may then get the deck's Card array using the getDeck() method
    • Deal cards to the computer and the player.
      • Note that you should not show the dealer's first card until after the player is finished
      • The player is dealt one card, then the dealer is dealt a hidden card, then one more to the player, then one more to the dealer
      • You can hard-code these four dealt cards -- meaning you don't need to use a loop here (and it's probably easiest not to)
    • Ask the player if s/he wants another card, and give the player cards until the user enters 'no'. Check for a 21 or a bust (going over 21) after each card is dealt.
    • If the player did not bust, deal cards to the computer (until the computer reaches or goes over 17, or busts)
    • Figure out who won (whoever is closest to 21 without going over--it could also be a tie!)
    • Ask to play again. If the player is playing again, it's easiest to fully re-create the deck each time.
  • Here is a sample execution:

    Let's play some blackjack!

    You are dealt a 6 of Spades
    Dealer is dealt a hidden card
    You are dealt a 2 of Diamonds
    Dealer is dealt a 4 of Hearts
    Your total is 8
    Would you like another card? (y/n) y
    You are dealt a Ace of Diamonds
    Your total is 19
    Would you like another card? (y/n) n

    The dealer's hidden card was a 8 of Hearts
    Dealer is dealt a 10 of Clubs
    The dealer's total is 22

    Your total is 19
    The dealer's total is 22
    The dealer busted! You win!

    Play another round? (y/n) n

Due: Blackjack due at the end of Wednesday


Friday - 10/27/06

Agenda:

  • Quiz 2 - Class Construction
  • DeckTestMain
  • Complete Deck class

Due: Deck class due today


Thursday - 10/26/06

Agenda:

  • Grades updated
  • Quiz Review
    • Class Construction (attributes, default constructors, specific constructors, accessors, mutators)
    • Object Usage (using an object and its methods)
  • Deck class extension because Mr. Bui was a n00b
  • Explanation of Deck class's shuffle() method

QUIZ tomorrow on class construction and object usage

Due: Deck class is due at the end of tomorrow


Wednesday - 10/25/06

Agenda:

  • Work on Deck class assignment
  • Initializing the Card array in the Deck constructor is a little different. When we initialize the array, we have an array of Card references, but none of the references initially point to anything. We must also tell each reference to point to a new Card instance. For example: deck[i] = new Card();
  • For the Deck constructor, try using a loop to iterate through the private Card array. If i is in the inclusive interval 0 ... 51 then a card is configured in the following manner:
    • If 0 <= i < 13 then the card is a club
    • If 13 <= i < 26 then the card is a diamond
    • If 26 <= i < 39 then the card is a heart
    • If 39 <= i < 52 then the card is a spade
    • If i % 13 is 0 then the card is an Ace
    • If i % 13 is 1, then the card is a 2
    • ...
    • If i % 13 is 09, then the card is a 10
    • If i % 13 is 10, then the card is a Jack
    • If i % 13 is 11, then the card is a Queen
    • If i % 13 is 12, then the card is a King
  • We generate random numbers by creating an instance of the Random class: Random myRand = new Random(). We may then use the Random object's nextInt(int N) method to generate a random number between 0 and up to, but not including some integer N by saying int randomNumber = myRand.nextInt(N); In our case, N would be the total number of cards in our deck. The Random class's Javadoc may be found here
  • The shuffle() method would first create an instance of the Random class. After that, there should be a loop that iterates a bunch of times (you decide how many). Inside the body of the loop, we use our Random object to generate two random numbers. These two random numbers are indices to two Card elements in our Card array. We then want to swap the two elements at those two indices. By swapping a whole bunch of times, we are "shuffling" the deck
  • Don't forget to create the mutator and accessor method for your one private Card array attribute!

Due: At the end of class Friday


Tuesday - 10/24/06

Warmup:

Agenda:

  • Deck assignment
    • Create a class named Deck
    • Import the Java Random library by adding the following at the top of your class: import java.util.Random
    • Deck should have one private attribute: an array of 52 Card instances
    • Deck should only have one constructor, the default constructor. The default constructor should initialize the Card array and all the names and values of its array elements. For example, you want to initialize one of your cards to be the Ace of Spades. A helpful method to set the values of cards is Integer.toString(int num), which returns the String representation of an integer x. Loops are also suggested to set the suits and values of cards.
    • Create a mutator and accessor for the private array attribute. The return type would be something along the lines of: Card []
    • Lookup Java random numbers and try to figure out how to create Random numbers in Java. How would you use this in your Deck class? Implement a shuffle() method that uses the swapping of random cards

Due: At the end of class Friday

QUIZ ON FRIDAY!! Quiz will be on class construction and object method usage.


Monday - 10/23/06

Agenda:

Due: At the end of class today


Friday - 10/20/06

Agenda:

  • Quiz (15 minutes)
  • Work on Circle class assignment
  • Work on Card class assignment

Assignment:

  • Complete Circle Assignment
  • Complete Card Assignment

Circle Due: At the end of class today

Card Due: At the end of class Monday (10/23/06)


Thursday - 10/19/06

Agenda:

  • Listen to Mr. Bui complain about his computer breaking
  • Check grades
  • Get checked off for any late assignment
  • Circle assignment extension
  • Quiz Review
    • program tracing
    • variable declaration
    • arrays
    • looping
    • if statements
    • boolean logic
  • Work on Circle class assignment
  • Work on Card class assignment

Assignment:

  • Complete Circle Assignment
  • Complete Card Assignment

Circle Due: At the end of class Friday (10/20/06)

Card Due: At the end of class Monday (10/23/06)


Wednesday - 10/18/06

Agenda:

  • Get checked off for any late assignment submission
  • Get checked off for Circle Assignment
  • Card Assignment
    • You will create a class named Card. The Card class will have the properties and methods of a blackjack card.
    • Declare all your data members (properties) to be private. You should have two String data members: suit and value
    • Create two constructors: one default Card() constructor and one specific constructor that takes two parameters: Card(String newSuit, String newValue)
    • Create accessor methods for each of the data members: getSuit() and getValue()
    • Create an accessor method called getCardValue() which will return the integer value of the card. For example, if your card name is "Ace" then return 11 (assume that aces are all 11). The "5 of Diamonds" getCardValue() method should return the integer 5.
    • Create mutator methods for each of the data members
    • Create a print method which will print out the name and suit of the card (e.g. "3 of Spades")

Assignment:

  • Complete Card Assignment

Due: At the end of class Monday (10/23/06)


Tuesday - 10/17/06

Agenda:

  • Get checked off for finishing MoreStringFun assignment and any late assignment submission
  • Quiz on Friday
  • Introduction to Classes
  • Rectangle class
  • RectangleTestMain class
  • Circle Assignment
    • Create a Java class named Circle
    • What is the most important attribute of any circle? Create this private data member (attribute) and make sure it can handle decimal numbers.
    • Create two constructors. The default constructor Circle() should set the radius to a default value of zero. The specific constructor Circle(double r) should set the radius to the value of the passed in parameter.
    • Create an accessor (getter) method that returns the value of the radius attribute.
    • Create a mutator (setter) method that changes the value of the radius attribute. Make sure that this method has a single parameter (the new radius)
    • Create a facilitator method that returns the size of the circle
    • Create another Java class that has a main method to test all the methods of your Circle class. Name this new test class CircleTestMain

Assignment:

  • Complete Circle Assignment

Due: At the end of class Friday (10/20/06)


Monday - 10/16/06

Agenda:

  • Get checked off for finishing StringSearch assignment
  • Quiz on Friday
  • Object Usage Review
  • MoreStringFun Assignment
    • Create a Java class named MoreStringFun
    • Prompt the user for a String
    • Output back to the user his/her String in all uppercase letters
    • Output how many words are in the String (Hint: Count the number of spaces in the String)
    • What if I entered this String: "blah blah blah"? If your program does not output that there are 3 words in "blah blah blah," then you should fix it!

Assignment:

  • Complete MoreStringFun

Due: At the beginning of class tomorrow.


Friday - 10/13/06

Agenda:

  • 3rd Period:
    • Get checked off for EmailHarvester
    • Work on PhoneNumberFun (found below under Thursday - 10/12/06)
    • When PhoneNumberFun is complete, work on StringSearch
  • 4th Period:
    • Get checked off for PhoneNumberFun
  • StringComparisonDemo
  • StringSearch Assignment
    • The purpose of this program is to search an array and return the number of occurences of a word
    • Create a Java class named StringSearch
    • Declare and explicitly initialize an array with the words found here
    • Prompt the user for a word to search and count in the array
    • NOTE: Several words appear multiple times in the array!
    • Traverse through the array and count the number of times the user's word appears
    • NOTE: The boolean == does not work exactly as you would like with references...you should use the String class's boolean comparison method. If you cannot remember what the method is, then look it up in String's Javadoc
    • Output the array to the screen
    • Output the number of times that the word appears

Assignment:

  • Complete StringSearch

Due: At the beginning of class Monday (both periods!).


Thursday - 10/12/06

Agenda:

  • Get checked off for EmailHarvester
  • Object Usage Review
  • PhoneNumberFun Assignment
    • The purpose of this program is to prompt a user for a telephone number of the form ddd–ddd–dddd, where d is a digit. The program then displays the phone number in the following format: (ddd) ddd–dddd.
    • Create a class called PhoneNumberFun
    • Prompt the user for a phone number of the form ddd-ddd-dddd
    • Output the area code back to the user
    • Output the local number back to the user
    • Output the phone number in the following format: (ddd) ddd-dddd
    • Here is a sample execution:
    • Phone number conversion
      	
      Enter the phone number in ddd-ddd-dddd format:
      434-867-5309
      The area code is 434
      The local number is 867-5309
      The reformatted phone number is (434) 867-5309
      

Assignment:

  • Complete PhoneNumberFun

Due: At the beginning of class Friday (4th Period).


Wednesday - 10/11/06

Agenda:

  • Checkoff any late assignments
  • Introduction to Objects
  • EmailHarvester Assignment

    • You are going to develop a program that extracts e-mail addresses from sentences that the user inputs

    • For this program, the user will enter a entire line of text, such as:

      Write the authors at javaprogramdesigne@mhhe.com some day.

    • Note that the program assumes that the e-mail address is within an entire sentence - i.e., that there is a space both before and after it. So when you test your program, make sure you have a word or two both before and after the e-mail address.

    • The program must extract the e-mail address (javaprogramdesigne@mhhe.com) from the passed in String.  Note that the string may have a number of words both before and after the e-mail address.  You can assume that the text the user enters will have one and only one '@' character.

    • The program has a series of steps that you must complete...

    • Step 0: Create a Java class named EmailHarvester.

    • Step 1: Prompt user for input text message. This just prints a message telling the user to enter a line of text that contains an e-mail address.

    • Step 2: Get input text message from the keyboard.

    • Step 3: Find the index of the '@' character in the message. Do this via the String class's indexOf() method. More information about this method can be found in the documentation for the String class. Save the index of '@' as an int variable named j, and print it out to the screen.

    • Step 4: Find the index of the space at the beginning of the e-mail address.  This is done via the lastIndexOf() method (details of which can be found in the documentation for the String class).  Essentially, you want to search backwards (via lastIndexOf()) from the '@' character (you know the position of the '@' from the last step) to find the space at the beginning of the e-mail address. Save this value as an int variable i, and print it out to the screen.

    • Step 5: Find the index of the space at the end of the e-mail address.  This is done via the indexOf(str, fromIndex) method (details of which can be found in the documentation for the String class). Save this value as an int variable k, and print it out to the screen.

    • Step 6: Set the e-mail address to the String from i to k.  This is done via the substring() method.  Save it into an appropriately named String object (you pick the name).

    • Step 7: Print out the e-mail address.  This just prints out the e-mail address from step 6.

Assignment:

  • Complete E-mailHarvester

Due: At the beginning of class Friday (3rd Period).

Due: At the beginning of class Thursday (4th Period).


Tuesday - 10/10/06

Agenda:

Assignment:

  • Complete E-mailHarvester

Due: At the beginning of class Thursday (4th Period)


Friday - 10/6/06

Agenda:

  • Complete ArrayInput and show Mr. Bui
  • If you have not shown Mr. Bui MyFirstArrayProgram or FindMinMax, please do so.

Assignment:

  • Complete any work you have not turned in.


Thursday - 10/5/06

Agenda:

  • Complete FindMinMax and show Mr. Bui
  • Review FindMinMax algorithms
  • This program will take in input from the user to populate (fill) the array with values. You will then find the minimum, maximum, and mean of the array's values. Follow the following steps:
    • Create a Java class named ArrayInput
    • Declare and initialize an array of size 5 that can handle decimal numbers. (Hint: Use a type other than int)
    • Use a for loop to prompt the user for decimal values and store them in each of the array's elements (slots). The for loop should prompt the user 5 times because the array is only of size 5.
    • Calculate the min, max, and mean of the values in the array. Hint: You've seen this all of this before
    • Output (print) all of the values of the array.
    • Output the min, max, and mean of the array
    • Don't forget to test your code with decimal numbers!
    • Now, change your code so that you're not limited to only 5 numbers
      • At the beginning of your program, prompt the user for the initial size of the array.
      • Instead of initializing the size of the array to 5, initialize it to the size that the user inputs.
      • If you are done with everything, show Mr. Bui your program and help somebody who is not done

Assignment:

  • Complete ArrayInput lab

Due: At the beginning of class tomorrow


Wednesday - 10/4/06

Agenda:

  • Complete MyFirstArrayProgram and show Mr. Bui
  • MyFirstArrayProgram review
    • Declaring arrays
    • Initializing arrays
    • Assigning values to array elements
    • Traversing arrays
  • Trace through ArrayAverage.java
  • Create a Java class named FindMinMax
    • Declare and initialize the same array from ArrayAverage.java
    • Using a for loop, find the minimum number in the array
    • Using a for loop, find the maximum number in the array
    • Output to the user all the elements in the array
    • Output to the user the minimum and maximum numbers of the array
  • If you are done with everything, show Mr. Bui your program and help somebody who is not done
  • Still having trouble working on Java assignments at home?!?
    • Install JCreator LE version
    • Don't forget, you need to have already installed the Sun Java Development Kit (which is also available at the JCreator link, but listed as SUN J2SDK 1.5)
    • JCreator LE may require you to provide an e-mail, so just give it a junk account

Assignment:

  • Complete FindMinMax lab

Due: At the beginning of class tomorrow


Tuesday - 10/3/06

Agenda:

  • Return graded work
  • Check grades online
  • Introduction to Java arrays
  • Receive textbooks
  • Create a Java class named MyFirstArrayProgram
    • Declare an int array variable named myIntArray
    • Allocate memory for an int array of size 20 and make myIntArray reference it
    • Initialize all the elements in myIntArray to 0 (zero)
    • Fill each element of myIntArray with the square of the element's index
    • Element at index 0 will contain 0
      Element at index 1 will contain 1
      Element at index 2 will contain 4
      Element at index 3 will contain 9
      ...

    • Print out all the elements of the array
  • When MyFirstArrayProgram is complete, show Mr. Bui to get checked off

Assignment:

  • Complete MyFirstArrayProgram

Due: At the beginning of class tomorrow!


Monday - 10/2/06

Agenda:

  • Complete and turn in PrintSequence and PrintCrazySequence lab (5 minutes)
  • Boolean Review
  • Take out a piece of paper and answer the the following questions *individually*. If you do not know the answer, please write "No B.S."
  • Examine Nand.java which has the following truth table:

  • p q p nand q
    true true false
    true false true
    false true true
    false false true

    (1 minute) How would we restructure the code so that we only use one if-else statement?

  • Examine Mystery.java
  • (1 minute) What is the logical error in the code?

  • Examine Predict.java
  • (15 minutes total)

    For what values of p, q, and r would the program to print "1"?

    For what values of p, q, and r would the program to print "2"?

    For what values of p, q, and r would the program to print "3"?

    For what values of p, q, and r would the program to print "4"?

    For what values of p, q, and r would the program to print "5"?

  • When you are finished answering all the questions, turn in your answers. We will then go over the answers.

Assignment: None


Friday - 9/29/06

Agenda:

  • Complete AverageFun lab and turn it in
  • Work on PrintSequence and turn it in when complete
  • Work on PrintCrazySequence and turn it in when complete
  • If you are done with everything, help somebody who is not

Assignment:

  • Complete PrintSequence and PrintCrazySequence labs

Due: At the beginning of class Monday - 10/2/06


Thursday - 9/28/06

Agenda:

  • Complete AverageFun, print it out, and turn it in by the end of class.
  • Begin working on PrintSequence assignment:
    • Create a class called PrintSequence
    • Output to the user that this program will print out a bunch of numbers
    • Prompt the user for an integer
    • Use one or more for loops to print out the first N terms of this sequence:

      2 4 8 16 32 ...

      where N is the integer that the user initially inputs

    • Upon completion, print out PrintSequence and put it on my desk
  • Begin working on PrintCrazySequence assignments:
    • Create a class called PrintCrazySequence
    • Output to the user that this program will print out a bunch of CRAZY even numbers
    • Prompt the user for an integer
    • Use one or more for loops to print out the first N terms of this sequence:

      2 44 888 16161616 3232323232 ...

      where N is the integer that the user initially inputs

    • Notice that the basic terms are the same as in PrintSequence, but here there are two of the second term (that is, two fours), three of the third term (that is, three eights), etc.
    • Upon completion, print out PrintCrazyEvens and put it on my desk

Assignment:

  • Complete PrintSequence
  • Complete PrintCrazySequence

Due: At the beginning of class on Monday - 10/2/06


Wednesday - 9/27/06

Agenda:

  • Create a Java class called AverageFun
  • The program continues to prompt the user to input an integer and then reads in an integer. The program should only stop taking input when the user types a -1.
  • After the program stops taking input, it should print two things:
    • The number of integers the user typed in (not including the -1).
    • The average of all of those integers. Recall that the average if a set of numbers is simply the sum of all of those numbers divided by the number of integers. Keep in mind that the average of a number of integers need not be an integer!
  • Here is an example run of the program:
  • Please type an integer (-1 to stop): 1
    Please type an integer (-1 to stop): 2
    Please type an integer (-1 to stop): 3
    Please type an integer (-1 to stop): 4
    Please type an integer (-1 to stop): 25
    Please type an integer (-1 to stop): -1


    There were 5 integers entered.

    Their average is 7.0

Assignment Complete AverageFun lab assignment

Due: At the beginnning of class Friday - 9/29/06


Tuesday - 9/26/06

Agenda:

  • Complete GuessingGame lab, print it out, and turn it in.

Assignment None


Monday - 9/25/06

Agenda:

  • Turn in Java Practice #1 worksheet
  • Download skeleton code of GuessingGame
    • Skeleton code already takes care of computer's guess
    • Print out a description of the game, saying that the user has five guesses to guess the computer's number (0 through 99 inclusive)
    • Prompt the user for a guess
    • Tell the user if the guess is correct or not. If the guess is incorrect, tell the user that he/she should guess lower or higher
    • After five attempts, if the user still guessed wrong, then tell them that they lose. If they guessed the number correctly, then tell them that they win!

Assignment Complete the GuessingGame lab

Due: At the end of class tomorrow - 9/26/06


Friday - 9/15/06

Agenda:

  • Complete PrintRectangle Lab by the end of class.
  • Work on practice worksheet

Assignment:

  • Install Java JDK
  • Complete practice worksheet

Due: At the beginning of class Monday - 9/25/06


Thursday - 9/21/06

Agenda:

  • Complete the OddOrEven Lab
  • Good programming practices
    • Proper indentation and whitespace
    • Commented header with name, period, date, and what the file does
    • Descriptive variable names
  • PrintRectangle Lab
    • PrintRectangle is a program that prompts the user for a string and two integers. It then prints out a rectangle whose height is equal to the first integer and width is equal to the second integer.
    • Create a class named PrintRectangle
    • Prompt the user for a String
    • Prompt the user for an int and store it in a variable called height
    • Prompt the user for an int and store it in a variable called width
    • Print out a rectangle comprised of the user-input String whose height is equal to the first integer and width is equal to the second integer.
    • Some example outputs can be found here

Assignment: Complete PrintRectangle Lab

Due: At the end of class tomorrow (Friday - 9/22/06)


Wednesday - 9/20/06

Agenda:

  • Review
    • Datatypes
    • Variable Declaration
    • Operators
    • if statements
    • while loops
    • for loops
  • OddOrEven Lab (I'm not giving you skeleton code this time)
    • Create a class named OddOrEven
    • Prompt the user for an integer
    • Print out to the user if the number is odd or even
  • Good programming practices
    • Proper indentation and whitespace
    • Commented header with name, period, date, and what the file does
    • Descriptive variable names

Assignment: Install Java JDK on your home computer


Tuesday - 9/19/06

Agenda:

  • Complete Lab1.java
  • When complete, print out the code and turn it in to Mr. Bui
  • If you do not complete the lab, please come in after school to finish it

Assignment: Complete Lab1.java

Due: At the beginning of class tomorrow (Wednesday - 9/20/06)


Monday - 9/18/06

Agenda:

Assignment: Complete Lab1.java

Due: At the beginning of class Wednesday - 9/20/06


Friday - 9/15/06

Agenda:

  • Create a class named NumberFun
  • Declare three local variables in your main method, name them x, y, and z
  • Give x, y, and, z three random numbers (of your choosing)
  • Your program should output the minimum, the median, the maximum, and the average of the three numbers. Please make your output pretty.
  • When done with the programming assignment, read "Criteria for Success" on page 56 of the IB Dossier description
  • Begin working on your "Criteria for Success" section of your dossier

Assignment:

  • Work on your "Criteria for Success"
  • Have a great weekend!


Thursday - 9/14/06

Agenda:

  • Intro Java Assignment -- Adding even numbers
    • Create a Java class named AddEvens. Create a local integer variable in the main method and assign it a number of your choosing. The program will output the sum of all the even numbers from 0 through the number you hardcoded.
    • Work through pseudocode as a class
    • Code the assignment in Java on your own

Assignment:

  • Complete AddEvens assignment
  • Rough draft analysis section of dossier

Due: Friday - 9/15/06


Wednesday - 9/13/06

Agenda:

Assignment: Rough draft of dossier analysis section

Due: At the beginning of class on Friday - 9/15/06


Tuesday - 9/12/06

Agenda:

  • Receive personal accounts
  • Login to new accounts
  • Transfer old work to new account
  • Bookmark class webpage
  • Introduction to Java

Assignment: Rough draft of dossier analysis section

Due: At the beginning of class on Friday - 9/15/06


Monday - 9/11/06

Agenda:

  • Continue vocabulary review
  • Introduction to the DOSSIER

Assignment:

  • Read pages 58-69 of the IB Curriculum
  • Write a draft dossier analysis following the criteria in the IB Curriculum

Due: At the beginning of class on Friday - 9/15/06


Friday - 9/8/06

Agenda:

  • Continue vocabulary review

Assignment: None


Thursday - 9/7/06

Agenda:

  • Receive list of terms
  • Received specific assigned terms
  • Research terms
  • Present terms

Assignment: None


Wednesday - 9/6/06

Agenda:

  • Search the internet individually and try to come up with an answer to this question: "What is computer science?"
  • Introductions
  • Complete the survey located here

Assignment: None


Tuesday - 9/5/06

Agenda:

  • Introductions
  • Go over syllabus
  • Questions?

Assignment:

  • Read and sign the syllabus and have a parent/guardian read and sign it too.

Due: At the beginning of class on Friday - 9/8/06