CSE116: Computer Science 2

Spring 2023


Submit programming assignments
Code examples shown in lecture slides
Live code from section D
Live code from section E
Memory Diagram Reference
Watch this semester's lectures
Watch past lectures
Ask questions and find office hours
Chat with other students

Syllabus

Course Description

You know the basics of programming. You're proficient in variables, functions, control flow, data structures, and file IO. With these concepts, you can train a computer to complete nearly any task you can imagine. So what's next?

Writing large programs

You will learn how to write and organize large pieces of software. To this end, in CSE116 you will study:

  • Unit Testing
  • Classes and Object-Oriented Programming (OOP)
  • Data Structures & Algorithms

While studying these topics we will have a focus on how your programs work, not just that they work.

Expectations

This is not an easy course! To do well in this course you are expected to:

  • Invest a minimum of 12 hours/week* in CSE116 including at least 7 hours/week outside of class/lab
  • Want to learn about computer science (This is assumed since you are taking a second CSE course)
  • Be comfortable with all of the material from CSE115
  • Participate in every lecture and lab (There will NOT be a lab during week 1)
  • Have access to a computer with a reliable Internet connection

* The 12 hour/week minimum is an average. If you invest less than 12 hours/week in CSE116 during the first several weeks of the semester, or do not fully understand all the CSE115 topics, you should expect to work significantly more than 12 hours/week while you catch up. You should expect to spend 40+ hours in a single week on this course alone if you fall behind or if you're not comfortable with the CSE115 material.

CSE115 Review

If you did not take CSE115 at UB, or would otherwise like to review the material, below are some CSE115 resources to help you get caught up:

Keep in mind that you must understand the concepts of CSE115 and be prepared to apply them to the syntax of a new language (Java). You will not be required to write Python or JavaScript in CSE116.

Learning Objectives

Being successful in CSE116 requires completion of all of the learning objective requirements. You must complete every Learning Objective requirement in order to pass CSE116.

Learning objectives are divided into 2 primary categories:


Classes/Object-Oriented Programming (OOP)

Instead of writing programs as a collection of variables and functions, with object-oriented programming we will group these variables and functions into classes and objects. This allows developers to reason about their programs at a higher level of abstraction.

A student has completed this objective if they are able to:

  • Read/Quiz: Trace through the execution of programs that use classes, inheritance, and polymorphism while tracking the state of stack and heap memory using memory diagrams
  • Explain/Interview: Describe the concepts of classes, inheritance, and polymorphism and explain how they can be used to help us write software
  • Test: Write thorough unit tests to test code that uses classes, inheritance, and polymorphism
  • Write: Write programs that use classes, inheritance, and polymorphism

Data Structures & Algorithms

We will study several new approaches for storing data and computing with that data. Primarily, we will see linked-lists, trees, and graphs while exploring applications of each data structure.

A student has completed this objective if they are able to:

  • Read/Quiz: Trace through the execution of programs that use linked-lists, trees, and graphs using memory diagrams
  • Explain/Interview: Describe the structure of linked-lists, trees, and graphs and the implications of these structures including applications of each
  • Test: Write thorough unit tests to test code that uses linked-lists, trees, and graphs
  • Write: Write programs that use linked-lists, trees, and graphs as well as implement new algorithms to expand the functionality of each data structure

You must demonstrate that you've completed all learning objective requirements to earn a passing grade in this class. To complete a learning objective, you must complete all 4 portions (read, explain, test, write) of that category.


Learning Objective Completion

To complete the learning objectives of this course, you must complete all of the following requirements.

  • Read - Lab Quiz x6
    • There will be 6 lab quiz requirements that must be completed throughout the semester. These quizzes are labeled on the course schedule as:
      1. Classes 1 - Classes
      2. Data Structures 1 - Linked-Lists
      3. Classes 2 - Inheritance
      4. Data Structures 2 - Trees
      5. Classes 3 - Polymorphism
      6. Data Structures 3 - Graphs
    • Quizzes will be completed during your lab section and will assess you ability to trace through stack and heap memory during the execution of given code.
    • These quizzes are graded on a pass/fail basis. If you pass the quiz, you have completed the learning objective portion of that quiz. All completion decisions will be made by a human after reviewing your submission.
    • There are 2 lab quizzes on the schedule for each quiz labelled as "first chance" and "second chance". If you do not complete the quiz on the first chance, you can attempt the quiz again during the second chance quiz. If the course staff verifies that you've completed the learning objective on the first quiz, you do not have to take the quiz during the second chance lab.
  • Explain - Lab Interview x6
    • There will be 6 lab interview requirements that must be completed throughout the semester. These interviews are labeled on the course schedule as:
      1. Classes 1 - Classes
      2. Data Structures 1 - Linked-Lists
      3. Classes 2 - Inheritance
      4. Data Structures 2 - Trees
      5. Classes 3 - Polymorphism
      6. Data Structures 3 - Graphs
    • While you are taking your lab quiz, you will have a 10-minute interview with a TA. The TA may ask any questions they deem appropriate in order to assess that you can explain the relevant concept. The TA will submit a summary of your answers that will be reviewed by the course staff.
    • As with the lab quizzes, the interviews are graded on a pass/fail basis. After human review of your answers, it will be decided whether or not you completed the explain portion of the learning objective through your interview performance. If you complete the interview during the first learning objective verification lab, you do not have to interview again during the second verification lab.
    • Your interviewing TA does not make decisions for learning objective completion. Do not pressure your TA into marking you for completion. Likewise, your TA cannot tell you during the interview whether or not you passed since they will not know. The course staff will weigh all evidence while reviewing the reports from all TAs and efforts will be made to neutralize the variance between TAs (i.e. Your completion of learning objectives should not be affected by which TA you were assigned for an interview).
  • Testing and Write - Programming Tasks x9
    • There are 9 learning objective programming tasks assigned throughout the semester, 6 of which will involve writing code for functionality and 3 for writing unit tests. To complete the write portion of the learning objectives, you must complete all 9 tasks on time.
    • Programming tasks will be introduced, and discussed, during the week of lecture where the material needed to complete the task is covered. Each task is expected to be completed by the Wednesday morning following the introduction of the material. You should always aim to complete the task by this expected deadline. The actual deadline for each task will be the Wednesday morning 2 weeks after the material is covered. If you do not complete a task before it is due, you can no longer earn credit for the write portion of the learning objective, and you will fail the class. This is to prevent you from falling more than 2 weeks behind in this course. It is nearly impossible to overcome a 2-week deficit in this course. Do your work early, stay up to date on the course, and you will not have to worry about these deadlines.

Recovery Opportunities: The grading policy, at least at first glance, is very harsh. If you miss any learning objective requirement, you fail the course. In reality, we understand that life happens. You might get sick, your car might break down on your way to lab, or you might have 4 midterms in 1 week and not have time to work on CSE116. To address this, the course already has 2 opportunities for each quiz and interview, and the deadline for each programming task has been extended by 1 week from the expected/reasonable deadline to effectively give you 2 chances for each requirement. For cases when 2 opportunities are not enough, you can use recovery opportunities.

You have 4 recovery opportunities to use throughout the semester which can be used to earn another opportunity to complete a quiz, interview, or programming task. If you use a recovery opportunity for a Quiz or Interview, you can take the Quiz/Interview in lab the week after the second chance lab (Labelled "Recovery opportunity" on the course schedule. If you use a second recovery opportunity on a quiz or interview, we will schedule a makeup quiz or interview for you at a time outside of lab. If you use a recovery opportunity on a programming task, you will be given an additional 1-week extension on that task.

Recovery opportunities cannot be used to extend the deadline of application objectives, nor to earn another chance for the quiz application objectives..

  • Recovery opportunities will be used automatically if they are needed. Since the alternative is failing the course, we will assume that you want to use them if you don't complete a quiz/interview/task
  • You can use multiple recovery opportunities on the same quiz/interview/task if needed

Learning Objective Requirements Completed Grade
All Programming Tasks, Quizzes, and Interviews Grade depends on the number of Application Objectives completed
Less Than All Programming Tasks, Quizzes, and Interviews F

Application Objectives

If you have completed all of the learning objectives, your grade will be determined by the number of application objectives you've completed. Your final letter grade will be determined as follows:

Application Objectives Completed Grade
15-17 A
14 A-
13 B+
11-12 B
9-10 B-
7-8 C+
5-6 C
3-4 C-
0-2 D+
0+, but did not complete all Learning Objectives F


Application Objectives

You can improve your letter grade by showing that you can apply the learning objectives to solve real-world problems. You will have the following opportunities to complete application objectives.

  • Programming Projects x6
    • The programming tasks for weeks 11-13 (3 tasks) will each provide an opportunity to earn 2 Application Objectives for a total of 6 Application Objectives. The deadline for these tasks will be equivalent to the expected deadlines of Learning Objective programming tasks.
    • Deadlines cannot be extended on these tasks. You cannot use recovery opportunities on these tasks.
  • Programming Task Expected Deadlines x3
    • Each of the first 9 programming tasks (Only tasks related to Learning Objectives) has 2 deadlines. The first is the expected deadline which is the time at which the course staff expects a student who is putting in their 12 hours/week to complete the task. If this course used standard percentage-based grading, this would be the only deadline. Since the consequences are so harsh for missing a single task (To ensure that you learn all of the material) the actual deadlines have been extended by 1 week to give you ample time to study the material. However, to encourage you to still meet the expected deadlines, you can earn application objectives by completing tasks before these expected deadlines.
    • If you complete at least 2 of the 9 programming tasks before their expected deadlines, you will earn 1 application objective.
    • If you complete at least 5 of the 9 programming tasks before their expected deadlines, you will earn 2 application objective.
    • If you complete at least 7 of the 9 programming tasks before their expected deadlines, you will earn 3 application objectives.
  • Quizzes/Final Exam x6
    • On each of the 6 lab quizzes, you have the opportunity to earn an application objective. To earn this application objective on a quiz, you must demonstrate a deep understanding of the execution of the programs through your memory diagrams. Any mistake made that is fundamental to the concepts being accessed with disqualify you from this application objective.
    • You can earn this application objective on the first 2 attempts of a quiz. You cannot earn the same application objective more than once (ex. If you earn the application objective on the first chance quiz, there's no benefit of taking the second chance for that same topic). You cannot earn this application objective on any quiz attempt for which you used a recovery opportunity (third+ attempt).
    • You will have a third opportunity to earn these application objectives on the final exam. The final exam will contain memory diagram quiz-style questions for all 6 of the quiz topics. You only need to take the sections of the exam for the quiz Application Objectives that you did not earn in the first 2 attempts of the quiz. You cannot complete any Learning Objective requirements on the final exam.
    • If you earned all 6 application objectives on the quizzes, or if you already earned an A in the course, there's no reason for you to take the final exam.
  • Lecture Questions x2
    • Most lectures will include multiple choice questions to be answered during live lectures. These will be simple questions designed to encourage you to attend lecture and stay up to date on the material. Since lectures will be recorded, there is a temptation to watch lecture days, or even weeks, after they occur. These questions are to serve as an incentive for you to attend lecture and avoid falling behind in the course.
    • If you answer >=60% of the total available lecture question correctly, you will earn 1 application objective.
    • If you answer >=80% of the total available lecture question correctly, you will earn 2 application objectives.

Summary of Objectives

There's a lot to keep track of with the Learning Objectives and Application objectives. This chart shows a summary of when you ar e expected to earn each objective.

WeekQuizInterviewProgramming TaskExpected DeadlineLecture Question
1 2
2 3
3 LO 1 3
4 LO+AOLO LO 1 3
5 LO+AOLO LO 1 3
6 LO 1 3
7 LO+AOLO LO 1 3
Break
8 LO+AOLO LO 1 3
9 LO 1 3
10 LO+AOLO LO 1 3
11 LO+AOLO LO 1 3
12 2 AO 3
13 2 AO 3
14 2 AO 3
Total 6 LO + 6 AO6 LO 9 LO + 6 AO 3 AO 2 AO


Expected Deadlines Met Application Objectives Earned
7-9 3
5-6 2
2-4 1
0-1 0


Lecture Questions Answered Correctly Application Objectives Earned
33-41 (>=80%) 2
25-32 (>=60% && <80%) 1
0-24 (<60%) 0

Readings

There is no textbook for this course. Instead, links to relevant readings and tutorials are provided in the course schedule. When a reading is listed you should study it before lecture.

Academic Integrity

CSE Department Academic Integrity Policy:
https://engineering.buffalo.edu/computer-science-engineering/information-for-students/undergraduate-program/cse-undergraduate-academic-policies/cse-academic-integrity-policy.html

UB Academic Integrity Policy:
https://catalog.buffalo.edu/policies/integrity.html

In addition to the department and university policies, the following details apply to this course.

All submitted work must be of your own creation, and you must not share your submission with anyone else. If any submission is very similar to code that has been submitted by another student, or can be found online, it is in violation of this courses academic integrity policy and all students will be penalized whether they were copying or sharing their code with other students so they can copy. If two submissions are similar beyond what is likely if the students worked independently, then both students are in violation of the academic integrity policy.

All violations will result in:

An F in CSE116.

It is your responsibility to understand what constitutes an academic integrity violation. If you have any question whether something you are doing is a violation or not, ask for clarification before receiving an F in the course. I will not entertain excuses after you have been caught.

Examples of acceptable behavior:

  • Discussing an assignment with your classmates and brainstorming abstract solutions, then writing the code independently
  • Forming study groups and discussing course material and assignments on Discord, Zoom, etc.
  • Searching the Internet for supplementary material on the course topics
  • Asking the teaching staff for clarification on a homework question
  • Having, or hiring, someone to help you understand the concepts of the course

Examples of unacceptable behavior:

  • Pressuring a TA to falsify an interview report.
  • Submitting code, or other work, for course credit that is not your own.
  • Collaborating with another student to write code for an assignment. <-- This is the most common type of violation. DO NOT write code together!
  • Allowing another student to see your code or submission for an assignment.
  • Allowing another student to access your work that will be submitted for course credit. (Examples: Do not post you code publicly, host your code in a public repository, or allow a classmate to access your laptop)
  • Having someone help you write code.
  • Hiring someone to write code for you.
  • Copying a large amount of material found on the Internet into your submission.
  • Attempting to access the grading code on AutoLab.

If you plan on cheating, plan on taking this course again.


Week 1: Introduction to Java
Programming Task 1: Testing 1
Lab: No Lab
Monday
January 30
Course Introduction
Wednesday
February 1
Introduction to Java - Slides
Friday
February 3
Java Loops and Conditionals - Slides
Week 2: Testing 1 - Unit Testing
Finish Programming Task 1: Testing 1
Lab: IntelliJ Setup
Monday
February 6
Java Data Structures - Slides
Wednesday
February 8
Unit Testing - Slides
Friday
February 10
Testing and Recursive - Slides
Week 3: Classes/OOP 1 - Classes
Programming Task 2: Classes 1
Lab: Memory Diagrams Practice
Monday
February 13
Classes and Objects - Slides
Wednesday, February 15 @ 9:00 AM
Programming Task 1: Testing 1 Expected Deadline
Wednesday
February 15
Classes and Objects - Slides
Friday
February 17
Testing Classes and Examples - Slides
Week 4: Data Structures 1 - Linked Lists
Programming Task 3: Data Structures 1
Lab: Quiz and Interview
Classes 1 (First Chance)
Monday
February 20
Linked List Structure - Slides
Wednesday, February 22 @ 9:00 AM
Programming Task 1: Testing 1 Deadline
Wednesday, February 22 @ 9:00 AM
Programming Task 2: Classes 1 Expected Deadline
Wednesday
February 22
Linked List Algorithms - Slides
Friday
February 24
Stack and Queue - Slides
Week 5: Testing 2 - Testing Strategies
Programming Task 4: Testing 2
Lab: Quizzes and Interviews
Data Structures 1 (First Chance)
Classes 1 (Second Chance)
Monday
February 27
Testing with Structure
Wednesday
March 1
Testing Linked Lists and Trees
Friday, March 3 @ 9:00 AM
Programming Task 2: Classes 1 Deadline
Friday, March 3 @ 9:00 AM
Programming Task 3: Data Structures 1 Expected Deadline
Friday
March 3
The Debugger
Week 6: Classes/OOP 2 - Inheritance
Programming Task 5: Classes 2
Lab: Quizzes and Interviews
Data Structures 1 (Second Chance)
Classes 1 (Recovery Opportunity)
Monday
March 6
Inheritance - Slides
Wednesday, March 8 @ 9:00 AM
Programming Task 3: Data Structures 1 Deadline
Wednesday, March 8 @ 9:00 AM
Programming Task 4: Testing 2 Expected Deadline
Wednesday
March 8
Inheritance and Override - Slides
Friday
March 10
Sorting with Comparators - Slides
Week 7: Data Structures 2 - Trees
Programming Task 6: Data Structures 2
Lab: Quizzes and Interviews
Classes 2 (First Chance)
Data Structures 1 (Recovery Opportunity)
Monday
March 13
Binary Trees and Traversals - Slides
Wednesday, March 15 @ 9:00 AM
Programming Task 4: Testing 2 Deadline
Wednesday, March 15 @ 9:00 AM
Programming Task 5: Classes 2 Expected Deadline
Wednesday
March 15
Binary Search Trees (BSTs) - Slides
Friday
March 17
Binary Tree Examples
Spring Break!
Monday
March 20
No Class
Wednesday
March 22
Rest and Relax
Friday
March 24
Mental Health Day
Week 8: Testing 3 - Testing and Files
Programming Task 7: Testing 3
Lab: Quizzes and Interviews
Data Structures 2 (First Chance)
Classes 2 (Second Chance)
Monday
March 27
Files and Exceptions - Slides
Wednesday, March 29 @ 9:00 AM
Programming Task 5: Classes 2 Deadline
Wednesday, March 29 @ 9:00 AM
Programming Task 6: Data Structures 2 Expected Deadline
Wednesday
March 29
Testing With Files
Friday
March 31
Debugger 2
Week 9: Classes/OOP - Polymorphism
Programming Task 8: Classes 3
Lab: Quizzes and Interviews
Data Structures 2 (Second Chance)
Classes 2 (Recovery opportunity)
Monday
April 3
Polymorphism - Slides
Wednesday, April 5 @ 9:00 AM
Programming Task 6: Data Structures 2 Deadline
Wednesday, April 5 @ 9:00 AM
Programming Task 7: Testing 3 Expected Deadline
Wednesday
April 5
Abstract Classes and Interfaces - Slides
Friday
April 7
Polymorphism Example - Slides
Week 10: Data Structures 3 - Graphs
Programming Task 9: Data Structures 3
Lab: Quizzes and Interviews
Classes 3 (First Chance)
Data Structures 2 (Recovery opportunity)
Monday
April 10
Graphs - Slides
Wednesday, April 12 @ 9:00 AM
Programming Task 7: Testing 3 Deadline
Wednesday, April 12 @ 9:00 AM
Programming Task 8: Classes 3 Expected Deadline
Wednesday
April 12
Graph Examples - Slides
Friday
April 14
Breadth-First Search (BFS) - Slides
Week 11: Testing AO - Advanced Testing
Application Objectives 1: Testing
Lab: Quizzes and Interviews
Data Structures 3 (First Chance)
Classes 3 (Second Chance)
Monday
April 17
Testing Tips - Slides
Wednesday, April 19 @ 9:00 AM
Programming Task 8: Classes 3 Deadline
Wednesday, April 19 @ 9:00 AM
Programming Task 9: Data Structures 3 Expected Deadline
Wednesday
April 19
Testing with Mocks - Slides
Friday
April 21
Debugger 3 - Slides
Week 12: Classes/OOP AO - The State Pattern
Application Objectives 2: Classes
Lab: Quizzes and Interviews
Data Structures 3 (Second Chance)
Classes 3 (Recovery opportunity)
Monday
April 24
State Pattern - Slides
Wednesday, April 26 @ 9:00 AM
Programming Task 9: Data Structures 3 Deadline
Wednesday, April 26 @ 9:00 AM
Application Objectives 1: Testing Deadline
Wednesday
April 26
State Pattern - Slides
Friday
April 28
State Pattern - Slides
Week 13: Data Structures AO - Advanced Data Structures
Application Objectives 3: Data Structures
Lab: Quiz and Interview
Data Structures 3 (Recovery opportunity)
Monday
May 1
Weighted Graphs - Slides
Wednesday, May 3 @ 9:00 AM
Application Objectives 2: Classes Deadline
Wednesday
May 3
Data Structures - Slides
Friday
May 5
Merge Sort - Slides
Week 14: Review
Lab: Review
Monday
May 8
TA Lecture - Slides
Wednesday, May 10 @ 9:00 AM
Application Objectives 3: Data Structures Deadline
Wednesday
May 10
OOP in Python - Slides
Friday
May 12
You Decide - Slides
Friday
May 19
Final Exam @ 11:45AM - 2:45PM [Check the Hub to find the room for your section]