Difference between revisions of "IB Computer Science 2"

From WLCS
Line 33: Line 33:
 
* Queue (array implementation) to repl.it
 
* Queue (array implementation) to repl.it
  
== Friday (9/27/19) ==
+
== [[IBCS2 - 1920 - September]] ==
'''Agenda:'''
 
* Poker Hands HW reminder
 
* Stacks Quiz on '''Tuesday (10/1/19)'''
 
** Be able to describe the characteristics of a stack
 
** Be able to explain the operations of a stack
 
** Be able to describe different stack applications
 
** If given a list or an array, be able to explain their use as stacks
 
** Be able to implement the programming code for a stack that uses an array
 
* Stacks quiz practice assignment - study the static stack code prior to attempting this assignment.  Try *not* to look at the old code. Try *not* to look at the visualization tool either
 
*# Create a new stack project
 
*# Create two files: StringStack.java and StackMain.java
 
*# Implement a static stack that stores String objects
 
*# You must implement and test the following methods:
 
*#* StringStack() constructors
 
*#* void push(String s) - pushes s onto the stack if it is not full
 
*#* String pop() - pops the top from the stack and returns it, return null if stack is empty
 
*#* String top() - returns the current top, return null if stack is empty
 
*#* isEmpty() - returns true if the stack is empty, false otherwise
 
*#* isFull() - returns true if the stack is full, false otherwise
 
*#* toString() - returns a String that contains all elements of the stack (top down with newlines)
 
** Write a main() that tests everything in your stack
 
 
 
== [https://docs.google.com/presentation/d/1PoA335gHnDCoWpGEpgHLDDaVzxjZ7fdE-oDaQaiENaQ/edit?usp=sharing Back to School Night] ==
 
 
 
== Wednesday (9/25/19) ==
 
'''Agenda:'''
 
* Here is a [https://docs.google.com/document/d/13zszogl61lWLjLoY8z_UPkiWlpvUgtUHd2eNCRf9sbI/edit?usp=sharing list of cards] and the integer values to create them
 
* Here are several [https://docs.google.com/document/d/11dQ7uXnSP1EWElcm5T57-2-ntDHSXsbo2bG61lEuj74/edit?usp=sharing test cases] and the integer values to create them. Note, I'm only give you test cases for the first few poker hands, you should be able to create your own for the rest
 
* Complete Poker Hands: Part 1
 
* Complete Poker Hands: Part 2
 
* Introduction to Stacks - [https://docs.google.com/presentation/d/1MQGdYjEFwKBwT9WJcb7ITlPRcgCOC2Py-Lk31QGEzb0/edit?usp=sharing Stacks slides]
 
** Be able to describe the characteristics of a stack
 
** Be able to explain the operations of a stack
 
** Be able to describe different stack applications
 
** If given a list or an array, be able to explain their use as stacks
 
** Be able to implement the programming code for a stack that uses an array
 
* [https://www.cs.usfca.edu/~galles/visualization/StackArray.html Stack array implementation]
 
* Study the code in [[Media:Stack.java]] and [[Media:StackMain.java]]
 
** Stack code walk-through.  We'll make a couple edits so it matches this [https://www.cs.usfca.edu/~galles/visualization/StackArray.html Stack array implementation]
 
* Stack quiz in your future...
 
 
 
'''Homework:'''
 
* Complete Poker Hands: Part 1
 
* Complete Poker Hands: Part 2
 
 
 
== Monday (9/23/19) ==
 
'''Agenda:'''
 
* Basic Card[] methods - implement the following, test, and demo for credit
 
** void printCards(Card[] cards)
 
*** Use a for loop to iterate through all the cards, and print them to the screen
 
** void shuffle(Card[] cards)
 
**# Write a for loop that runs a bunch of times (e.g. 10000)
 
**# Generate two random numbers from 0 to the length of cards
 
**# Swap the cards at the locations of the two random numbers
 
** void sort(Card[] cards)
 
*** Implement either selection sort or bubble sort to sort your Card[] array.  You can literally copy and paste your sorting code from before, and then tweak it to use the value of the cards (i.e. getValue())
 
*** You should be able to test your code by generating a bunch of cards, sorting it, and then printing it out.  They should display in order of value.
 
* Work on Poker Hands: Part 1
 
* Work on Poker Hands: Part 2
 
 
 
== Thursday (9/19/19) ==
 
'''Agenda:'''
 
* Class Construction Quiz
 
* Intro Poker Hand Methods
 
** int getHighCardValue(Card c0, Card c1, Card c2, Card c3, Card c4)
 
*** returns the value of the highest Card
 
** Do not continue with the other poker hand methods like above b/c we will be making new versions using arrays!
 
* Introduction to Arrays of Objects
 
** Walkthrough -- take notes!  Pay attention!
 
* String[] arrays
 
** String comparison methods review
 
** Sort a String[]
 
* Basic Card[] methods - implement the following, test, and demo for credit
 
** void printCards(Card[] cards)
 
*** Use a for loop to iterate through all the cards, and print them to the screen
 
** void shuffle(Card[] cards)
 
**# Write a for loop that runs a bunch of times (e.g. 10000)
 
**# Generate two random numbers from 0 to the length of cards
 
**# Swap the cards at the locations of the two random numbers
 
** void sort(Card[] cards)
 
*** Implement either selection sort or bubble sort to sort your Card[] array.  You can literally copy and paste your sorting code from before, and then tweak it to use the value of the cards (i.e. getValue())
 
*** You should be able to test your code by generating a bunch of cards, sorting it, and then printing it out.  They should display in order of value.
 
 
 
== Tuesday (9/17/19) ==
 
'''Agenda:'''
 
* Algorithm Identification Quiz 1
 
* Sorting Identification Quiz 1
 
* Class Construction Quiz on '''Thursday (9/19/19)'''
 
* Repl.it class construction assignments progress check
 
* Intro Poker Hand Methods
 
** int getHighCardValue(Card c0, Card c1, Card c2, Card, c3, Card c4)
 
*** returns the value of the highest Card
 
** Do not continue with the other poker hand methods like above b/c we will be making new versions using arrays!
 
* Introduction to Arrays of Objects
 
** Walkthrough -- take notes!  Pay attention!
 
* Basic Card[] methods - implement the following, test, and demo for credit
 
** void printCards(Card[] cards) - we will do this one together
 
*** Use a for loop to iterate through all the cards, and print them to the screen
 
** void shuffle(Card[] cards)
 
**# Write a for loop that runs a bunch of times (e.g. 10000)
 
**# Generate two random numbers from 0 to the length of cards
 
**# Swap the cards at the locations of the two random numbers
 
** void sort(Card[] cards)
 
*** Implement either selection sort or bubble sort to sort your Card[] array.  You can literally copy and paste your sorting code from before, and then tweak it to use the value of the cards (i.e. getValue())
 
*** You should be able to test your code by generating a bunch of cards, sorting it, and then printing it out.  They should display in order of value.
 
 
 
== Friday (9/13/19) ==
 
'''Agenda:'''
 
* Search & Sorting Algorithms Quiz on '''Tuesday (9/17/19)'''
 
** You should be able to identify the algorithm visually
 
** You should be able to identify the algorithm if given code
 
** You should be able to fill in missing lines of code for any algorithms
 
* Java Objects Slides
 
** [https://docs.google.com/presentation/d/1hb_8wMUlQQl7W-JF2f3gax021yDHLkLENJYy0fUMGy8/edit?usp=sharing Classes (Java) slides]
 
** [https://docs.google.com/presentation/d/1ks5B3fsnGCX_utk_Adxt1cQtPtUsNtNVENb9swCaHpo/edit?usp=sharing Object Usage (Java) slides]
 
** [https://docs.google.com/presentation/d/1Vq2mTZRJIBkwpsHqFmKRICpUOoqOOSKSyRKWMGKZovY/edit?usp=sharing Object-Oriented Programming (Java) slides]
 
* Point class assignment - complete in NetBeans or repl.it (*must* submit to repl.it for auto-testing)
 
*# You will create two java files: '''Point.java''' and '''Main.java'''
 
*#* '''Point.java''' - the Point class definition will be here
 
*#* '''Main.java''' - only the main() method will be located here
 
*# Declare and initialize the following '''private''' attributes in the Point class
 
*#* double x = 0.0
 
*#* double y = 0.0
 
*# Define two Point() constructors:
 
*#* default constructor: Point()
 
*#* specific constructor Point(double newX, double newY)
 
*# Define the following '''public''' methods in the Point class
 
*#* double getX() - returns the x-coordinate
 
*#* double getY() - returns the y-coordinate
 
*#* void setX(double newX) - sets the x-coordinate to the new x-coordinate parameter
 
*#* void setY(double newY) - sets the y-coordinate to the new y-coordinate parameter
 
*#* String toString() - returns a String representation of the Point object
 
*# Go to your Main.java file to test out your Point class
 
*# In the main method, create several new instances of Point objects
 
*# Print out each of your Point objects
 
*# Define a static method in Main.java named '''double slope(Point p1, Point p2)''' - returns the slope between p1 and p2
 
*# Test and print out your slope method when you use it with your instantiated Point objects in the main() method
 
* Complete the other repl.it assignments:
 
** Car class
 
** Vector class
 
** Card class
 
 
 
== Wednesday (9/11/19) ==
 
'''Agenda:'''
 
* Group sorting activity
 
*# Form 3-4 person groups
 
*# Receive playing cards
 
*# With your group, document an algorithm (steps) of how you sort the cards out
 
*# Paste your numbered steps in the appropriate document:
 
*#* [https://docs.google.com/document/d/1ydtes6Vppf66Xk1z2yC2N_kom2OnjdrAfmeWh9_4t70/edit?usp=sharing Period 4]
 
*#* [https://docs.google.com/document/d/1RFuWUM8vp-U3B3bdzEz8XI1f7-fWK1eTuFKdMjQ7Vro/edit?usp=sharing Period 6]
 
* Introduction to Sorting
 
** [https://docs.google.com/presentation/d/1Y5JOINM2w744nqimZf2iVuFpi6N6gM2B7GM4ArGjChQ/edit?usp=sharing Sorting slides]
 
* Selection sort assignment in repl.it
 
* Bubble sort assignment in repl.it
 
* Internal Assessment meetings
 
 
 
'''Challenge:'''
 
* Implement quick sort yourself
 
 
 
'''Homework:'''
 
* Complete both Selection Sort and Bubble Sort
 
 
 
== Monday (9/9/19) ==
 
'''Warmup:'''
 
* Complete the Find Min/Max repl.it
 
 
 
'''Agenda:'''
 
* Submit Guessing Game to repl.it
 
* [http://introcs.cs.princeton.edu/java/11cheatsheet/ Java Cheatsheet]
 
* [https://docs.google.com/presentation/d/1L-tbBp51YuUoTWldXFBr6JGcyHF5sBy_flfPGiqlVAQ/edit?usp=sharing Java Methods]
 
* [https://docs.google.com/a/apsva.us/presentation/d/1Ayzvd1q-6RwZKplUtLHDCCLyO5XIR5kyeKUi8-htErY/edit?usp=sharing Java Arrays]
 
** Additional review material: [[Media:IntroArrays.ppt]]
 
* [https://docs.google.com/presentation/d/1GLpwZbqLcyix2WHqS9lLJT3qCeIeWGQ9UDwr6f9VgoE/edit?usp=sharing Searching slides]
 
** Linear (Sequential) Search
 
** Binary Search
 
** Complete the LS and BS repl.it assignments
 
 
 
'''Homework:'''
 
* 1-2 sentence description of your Internal Assessment idea in Canvas
 
 
 
== Thursday (9/5/19) ==
 
'''Warmup:'''
 
* Complete the Student Survey in Canvas
 
* Complete the Abstract Data Structures Pre-assessment in Canvas
 
** Do not guess if you do not know the answer
 
 
 
'''Agenda:'''
 
* [[IBCS2 Summer Assignment]] reminder - '''due Monday (9/9/19)'''
 
* Misc Logistics:
 
** Mr. Bui has C Lunch
 
* [[IB Computer Science II Syllabus]]
 
** Complete online syllabus agreement form by '''Monday (9/9/19)'''
 
* Extra credit demonstrations?
 
** Why did Mr. Bui give this task?
 
* App Catalog (AirWatch) installers
 
** Java installer(s)
 
* Java Review - [http://introcs.cs.princeton.edu/java/11cheatsheet/ Java Cheatsheet]
 
* Recreate the [[Guessing Game Assignment]] in Java
 
** You can always refer to the [http://introcs.cs.princeton.edu/java/11cheatsheet/ Java Programming Cheatsheet]
 
** This exercises should take you no more than 10-15 minutes
 
* [[Internal Assessment]]
 
** Read the [[Media:IBCS_InternalAssessmentGuidelines.pdf]]
 
** Begin thinking/working on Criterion A
 
* Repl.it classroom
 
* Join our class: https://repl.it/classroom/invite/d4LbLcD
 
 
 
'''Homework:'''
 
* [[IBCS2 Summer Assignment]] due '''Monday (9/9/19)'''
 
* [[IB Computer Science II Syllabus]] agreement form by '''Monday (9/9/19)'''
 
* Complete the Java guessing game assignment
 
 
 
== Tuesday (9/3/19) ==
 
'''Agenda:'''
 
* [[IBCS2 Summer Assignment]] reminder - '''due Monday (9/9/19)'''
 
** Update your profile's last name so that it follows the following naming convention: # - Last Name (please note the spacing)
 
* Re-introductions & attendance
 
** [https://docs.google.com/presentation/d/1Nzo-2anihJvunXw6plSr3pdw9mS26Mv0CZLT-inhGoc/edit?usp=sharing About Me]
 
* [[IB Computer Science II Syllabus]]
 
* Complete syllabus agreement assignment in Canvas by '''Monday (9/9/19)'''
 
  
 
== [[IBCS2 - Archives]] ==
 
== [[IBCS2 - Archives]] ==

Revision as of 10:34, 4 October 2019

Thursday (10/3/19)

Agenda:

  • Complete Queue (array implementation) and submit to repl.it
  • If you have completed the Queue, then implement the circular queue data structure. Be sure you save as a new project or file and rename the class to CircularQueue. Do not overwrite your original queue code!
  • Mini queue quiz in the last 15 minutes of class

Homework:

Tuesday (10/1/19)

Agenda:

  • Stacks quiz
  • Submit your String Stack assignment to repl.it
  • Introduction to Queues - Queues slides
  • Play with the Queues Array Implementation
    1. What attributes of a queue should we keep track of?
    2. What happens to the tail when data is added?
    3. What happens to the head when data is removed?
  • Implement the Queue class and its methods:
    • Queue() constructors - use a default array size of 15
    • void enqueue(int data)
    • int dequeue()
    • void add(int data) - this method should only have one line of code!
    • int remove() - this method should only have one line of code!
    • boolean isEmpty()
    • boolean isFull()
    • int peek() - returns the head of the queue if it's not empty; Integer.MIN_VALUE otherwise
    • String toString()
  • Submit your queue (array implementation) to the repl.it assignment
  • Queue challenge: If you add() and remove() a bunch of times, eventually, your queue will fail to work because the head and tail will hit the end of the array. Prevent this from happening by making a "circular queue".

Homework:

  • Queue (array implementation) to repl.it

IBCS2 - 1920 - September

IBCS2 - Archives