CSE116: Computer Science 2

Spring 2024


Autolab Submit programming assignments
GitHub Example Code examples shown in lecture slides
GitHub Example Live code from section A
GitHub Example Live code from section C
GitHub Example Live code from section E
Tracing Tool Memory Diagram Tracing Tool
Memory Diagrams Memory Diagram Reference
YouTube Watch past lectures
Piazza Ask questions and find office hours
Discord 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)
  • Understand the basics of programming
  • Participate in every lecture and lab (There will NOT be a lab during week 1)

* 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 in CSE116.

Specifically, you are expected to understand the concepts of variables, expressions, functions, conditionals, loops, and reading CSV files.

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
  • Write: Write programs and testing 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 and trees using memory diagrams
  • Explain/Interview: Describe the structure and applications of linked-lists and trees
  • Write: Write programs and testing that use linked-lists, trees, and graphs as well as implement new algorithms to expand the functionality of each data structure

Learning Objective Completion

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

  • Read - Lab Quiz x6
    • There are 6 lab quiz requirements that must be completed throughout the semester. These quizzes are labeled on the course schedule as:
      1. Quiz 1 - Classes
      2. Quiz 2 - Linked-Lists
      3. Quiz 3 - Inheritance
      4. Quiz 4 - Trees
      5. Quiz 5 - Polymorphism
      6. Quiz 6 - Graphs
    • Quizzes will be completed during your lab section and will assess your 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 "1st chance" and "2nd 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.
    • If you do not complete all 6 quizzes after your first 2 attempts, you will be given a 3rd chance to complete each quiz during the final exam
  • Explain - Lab Interview x6
    • There are 6 lab interview requirements that must be completed throughout the semester. These interviews are labeled on the course schedule as:
      1. Interview 1 - Classes
      2. Interview 2 - Linked-Lists
      3. Interview 3 - Inheritance
      4. Interview 4 - Trees
      5. Interview 5 - Polymorphism
      6. Interview 6 - Graphs
    • During lab interviews 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 chance lab, you do not have to interview again during the second chance 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).
    • If you do not complete all 6 interview after your first 2 attempts, you will be given a 3rd chance to complete each interview during the final exam. The final exam interviews will be interview-style questions, but it will be a written exam where you'll write your answers to the questions
  • Write - Programming Tasks x8
    • There are 8 learning objective programming tasks assigned throughout the semester. To complete the write portion of the learning objectives, you must complete all 8 programming tasks.

Final Exam: The final exam is used as a 3rd chance to complete the quizzes and interviews. If you already completed all 6 quizzes and 6 interviews after the first 2 attempts for each, you do not need to attend the final exam.


Learning Objective Requirements Completed Grade
All 8 Programming Tasks, all 6 Quizzes, and all 6 Interviews Grade depends on the number of Application Objectives completed
Less than all Programming Tasks, all Quizzes, and all 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. Most application objectives are designed to incentivize you to keep up with the material of the course and are not meant to be overly difficult to earn. Your final letter grade will be determined as follows:

Application Objectives Completed Grade
44-47 A
41-43 A-
38-40 B+
35-37 B
32-34 B-
25-31 C+
18-24 C
11-17 C-
5-10 D+
0-4 D


Application Objectives

Falling even 1 week behind in this course will significantly increase your chances of failing. Application Objectives offer you incentives to stay up-to-date on the material by giving you chances to improve your letter grade.

  • Programming Task Expected Deadlines x16
    • Each of the 8 programming tasks have 3 separate deadlines. Completing all tasks before the earliest deadline will earn you a total of 16 application objectives. These deadlines are:
    • Expected Deadline: The expected deadline is set on the Friday night after the week when the material for the task was covered in lecture. As the name implies, this is when you are expected to be able to complete the task if you are keeping up with the course. Each time you complete a task before it's expected deadline, you will earn 2 application objectives
    • Late Deadline: This deadline is 1 week after expected deadline. Complete a task before this deadline to earn 1 application objective. This allows you a second chance to still earn an application objective even if you are failing behind in the course. If you are consistently relying on the late deadlines, you are at risk of failing the course and must work hard to catch back up
    • Final Deadline: The final deadline is 1 week after the late deadline. You must complete all 8 tasks before their late deadline or you will fail the course. This means that if you miss any of the 8 final deadlines, you will fail the course regardless of your performance throughout the rest of the course. This deadline is set a full 3 weeks after the content for the task has been covered in lecture. Students who fall more than 3 weeks behind in CSE116 are not able to catch back up and pass the course. This deadline removes any false hope you may have of catching up after falling so far behind. Meeting this deadline will not result in any application objectives
  • Application Objective Task x4
    • There are 2 additional programming tasks called the "Application Objective Tasks" that are not related to your learning objectives and therefore do not need to be completed to pass the class. These tasks offer the opportunity to earn 4 additional application objectives (2 application objectives each)
    • There's only 1 deadline for each application objective task. Each task is divided into 2 parts that are each worth 1 application objective so you can still earn 1 application objective even if you don't complete the entire task by the deadline
  • Quizzes x12
    • There are 6 quizzes that you must complete in order to pass the class with 3 opportunities to complete each one. These quizzes are graded on a pass/fail basis and you can earn application objectives based on how many attempts you needed to use in order to pass each quiz
    • If you complete a quiz during the 1st chance lab, you will earn 2 application objectives
    • If you complete a quiz during the 2nd chance lab [and did not complete it on the first chance], you will earn 1 application objective
    • If you need to take a quiz a 3rd time during the final exam, you cannot earn any application objectives for that quiz
  • Interview x12
    • The interviews follow the same structure as the quizzes:
    • If you complete an interview during the 1st chance lab, you will earn 2 application objectives
    • If you complete an interview during the 2nd chance lab [and did not complete it on the first chance], you will earn 1 application objective
    • If you need to take an interview a 3rd time during the final exam, you cannot earn any application objectives for that interview
  • Lab Absence Policy
    • For up to 2 total quizzes/interviews, you can earn the full 2 application objectives on your second attempt. This will be done automatically. It does not matter why you did not earn credit on the 1st attempt and you do not even have to attend the 1st attempt lab to have a chance for 2 AOs on the 2nd attempt. The reason for this policy is to avoid punishing a student who has a legitimate reason to miss a lab (eg. due to illness), assuming they complete all other interviews/quizzes on their 1st attempt.
    • Example: A student is doing well in the course and complete quiz/interview 1, 2, and 3 on the first attempt. For the 1st chance lab for interview and quiz 4, they were sick and could not safely attend lab. This student can attend the 2nd chance lab for interview and quiz 4 and if they pass both, they will still earn the full 4 applications objectives (2 from the quiz and 2 from the interview). If the student does not pass one of the remaining quizzes/interview (quiz/interview 5 and 6) on the 1st attempt, they can earn a maximum of 1 application objective each for them.
    • Note that the expectation is that every student completes every interview and quiz on the 1st attempt. Failure to do so will use up these 2 extra chances and you will not be able to use them later in the semester even if you are legitimately sick (Technically, you would use these 2 on the attempts for which you were sick so are not available for you on the ones that you attempted and failed)
    • If you have legitimate reasons for missing both the 1st and 2nd attempts for an interview/quiz, you can be given an extra attempt that may be scheduled outside of lab. To earn such an attempt, you must provide documentation that proves that you had to miss both weeks of lab (eg. a doctors note excusing you from classes with dates that cover both labs). If you legitimately had to miss 2 weeks of lab, you should have such documentation in your possession. Excuses without documentation will not be entertained (eg. You can't simply claim that you were sick for for that long)
  • Lecture Questions x3
    • Most lectures will include 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.
    • We will drop a total of 9 (3 full weeks worth) lecture questions that were either not submitted or submitted with an incorrect answer. You can use these 9 drops for any reason (Including illness or travel) and no additional drops will be given for any reason (ie. If you have to miss more than 3 full weeks of lecture, you have bigger problems to worry about than your lecture question points).
    • If, after the 9 drops, you answer all lecture questions correctly, you will earn 3 application objectives
    • If, after the 9 drops, you missed (either not submitted or submitted with an incorrect answer) between 1 and 7 lecture questions, you will earn 2 application objectives
    • If, after the 9 drops, you missed (either not submitted or submitted with an incorrect answer) between 8 and 14 lecture questions, you will earn 1 application objective
    • If, after the 9 drops, you missed (either not submitted or submitted with an incorrect answer) more than 14 lecture questions, you will not earn any application objectives from lecture questions

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 course's 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!
  • Using Artificial Intelligence to help you write code
  • 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
Lab: No Lab
Wednesday
January 24
Course Introduction
Friday
January 26
Introduction to Java - Slides
Week 2: Introduction to Java
Lab: IntelliJ Setup
Monday
January 29
Java Loops and Conditionals - Slides
Wednesday
January 31
Java Data Structures - Slides
Friday
February 2
Java Examples
Week 3: Testing 1 - Unit Testing
Programming Task 1: Unit Testing
Lab: Practice Quiz and Interview
Monday
February 5
Unit Testing - Slides
Wednesday
February 7
Testing Strings/doubles - Slides
Friday
February 9
Testing and Recursion - Slides
Week 4: Classes/OOP 1 - Classes
Programming Task 2: Classes
Lab: Practice Quiz and Interview
Monday
February 12
Classes and Objects - Slides
Wednesday
February 14
Classes and Objects - Slides
Friday
February 16
Testing Classes and Examples - Slides
Friday, February 16 @ 11:59pm
Task 1: Expected Deadline
Week 5: Data Structures 1 - Linked Lists
Programming Task 3: Linked Lists
Lab: 1st Chance - Classes Interview & Quiz
Monday
February 19
Linked List Structure - Slides
Wednesday
February 21
Linked List Algorithms - Slides
Friday
February 23
Stack and Queue - Slides
Friday, February 23 @ 11:59pm
Task 2: Expected Deadline
Friday, February 23 @ 11:59pm
Task 1: Late Deadline
Week 6: Testing 2 - Testing Strategies
Lab: 1st Chance - Linked List Interview & Quiz
Monday
February 26
Testing Tips
Wednesday
February 28
Testing Data Structures
Friday
March 1
Debugger and Testing
Friday, March 1 @ 11:59pm
Task 3: Expected Deadline
Friday, March 1 @ 11:59pm
Task 2: Late Deadline
Friday, March 1 @ 11:59pm
Task 1: Final Deadline
Week 7: Classes/OOP 2 - Inheritance
Programming Task 4: Inheritance
Lab: 2nd Chance - Classes/Linked List Interviews & Quizzes
Monday
March 4
Inheritance - Slides
Wednesday
March 6
Inheritance and Override - Slides
Friday
March 8
Sorting with Comparators - Slides
Friday, March 8 @ 11:59pm
Task 3: Late Deadline
Friday, March 8 @ 11:59pm
Task 2: Final Deadline
Week 8: Data Structures 2 - Trees
Programming Task 5: Trees
Lab: 1st Chance - Inheritance Interview & Quiz
Monday
March 11
Binary Trees and Traversals - Slides
Wednesday
March 13
Binary Search Trees (BSTs) - Slides
Friday
March 15
Binary Tree Examples
Friday, March 15 @ 11:59pm
Task 4: Expected Deadline
Friday, March 15 @ 11:59pm
Task 3: Final Deadline
Spring Break
Lab: No Lab
Monday
March 18
No Lecture
Wednesday
March 20
No Lecture
Friday
March 22
No Lecture
Week 9: Testing 3 - Testing and Files
Programming Task 6: Files
Lab: 1st Chance - Trees Interview & Quiz
Monday
March 25
Files and Exceptions - Slides
Wednesday
March 27
Testing With Files
Friday
March 29
Debugger Tips
Friday, March 29 @ 11:59pm
Task 5: Expected Deadline
Friday, March 29 @ 11:59pm
Task 4: Late Deadline
Week 10: Classes/OOP - Polymorphism
Programming Task 7: Polymorphism
Lab: 2nd Chance - Inheritance/Trees Interviews & Quizzes
Monday
April 1
Polymorphism - Slides
Wednesday
April 3
Polymorphism - Slides
Friday
April 5
Polymorphism Example
Friday, April 5 @ 11:59pm
Task 6: Expected Deadline
Friday, April 5 @ 11:59pm
Task 5: Late Deadline
Friday, April 5 @ 11:59pm
Task 4: Final Deadline
Week 11: Data Structures 3 - Graphs
Programming Task 8: Graphs
Lab: 1st Chance - Polymorphism Interview & Quiz
Monday
April 8
Graphs - Slides
Wednesday
April 10
Graph with BFS - Slides
Friday
April 12
Graph Examples - Slides
Friday, April 12 @ 11:59pm
Task 7: Expected Deadline
Friday, April 12 @ 11:59pm
Task 6: Late Deadline
Friday, April 12 @ 11:59pm
Task 5: Final Deadline
Week 12: AO1 - The State Pattern
Application Objective Task 1
Lab: 1st Chance - Graphs Interview & Quiz
Monday
April 15
The State Pattern - Slides
Wednesday
April 17
The State Pattern - Slides
Friday
April 19
The State Pattern - Slides
Friday, April 19 @ 11:59pm
Task 8: Expected Deadline
Friday, April 19 @ 11:59pm
Task 7: Late Deadline
Friday, April 19 @ 11:59pm
Task 6: Final Deadline
Week 13: AO2 - Algorithms
Application Objective Task 2
Lab: 2nd Chance - Polymorphism/Graphs Interviews & Quizzes
Monday
April 22
Algorithms
Wednesday
April 24
Algorithms
Friday
April 26
Algorithms
Friday, April 26 @ 11:59pm
Task 8: Late Deadline
Friday, April 26 @ 11:59pm
Task 7: Final Deadline
Friday, April 26 @ 11:59pm
Application Objective Task 1: Final Deadline
Week 14: Review
Lab: Review
Monday
April 29
Review
Wednesday
May 1
Review
Friday
May 3
Review
Friday, May 3 @ 11:59pm
Task 8: Final Deadline
Friday, May 3 @ 11:59pm
Application Objective Task 2: Final Deadline
Week 15: Final
Lab: No Lab
Monday
May 6
Review
Friday
May 10 @ 11:45am - 2:45pm
Final Exam

Website GitHub Website GitHub