Course web page: Introduction to Computer Science for majors II James Tam Return to the course web page

CPSC 233 Course web page: winter 2021

Index for the major parts of this site

Free resources for all U of C students

Technical requirements for students in the distance learning version of this course (paraphrased version from what was provided by the university).

 

Java information:

Java download site:

Setting up Java: Instructions from the company behind Java (owned by Oracle) in Windows. (The specifics are slightly different for Windows 10 but the basic idea is still the same.

For operating systems other than Windows: If you have problems or questions then we will do what we can to help. However, you need to keep in mind that we are limited to the resources we have available. (The university won't provide me with a MAC computer for instance so I can only use educated guesses or web searches to find answers).

New: this term some of my Teaching Assistants have a preference for MAC while some have a preference for Windows. Under "tutorial information" you can see the operating system that specific TAs will be using to produce their tutorial videos. If you want to get operating system specific information then you can view the videos of a teaching assistant who supports the O/S you use. Also if you have operating system specific questions then you can try asking your question in the CT session staffed by someone who is familiar with your operating system.

Setting up Java on the MAC (using a command line) or other UNIX based computer system.

(If you want to search for other resources then search for search terms such as "setting Java classpath" and  "setting Java paths " being sure to include your operating system in the search parameters). Make sure you follow a good source (such as Oracle) and you follow the steps precisely (sometimes making a small mistake may cause your computer to malfunction!)

Administrative information: lecture, grading, textbooks

Day/Time

Look for pre-recorded lectures under 'content' in D2L and lectures will be listed chronologically.

Contact Information

James Tam

 

Office time: Monday and Tuesday (1:00 - 1:50 PM) via a Zoom link: https://ucalgary.zoom.us/j/91266944736 (passcode = 'Hope')

 

Email: tam@ucalgary.ca

   
Official information Official course information sheet (summary of official course requirements as approved by the office of dean)

 

General assignment information Grade calculator to estimate your term grade: [Excel spreadsheet]

Academic misconduct vs. collaboration: what is allowed for this class

All assignments will be graded by your tutorial instructor. That is the first person to contact with questions about marking will be that person.

Books (available via the UC bookstore) Textbook (explanation of some course material): 

Walter Savitch, Kenrick Mock, ABSOLUTE JAVA: Pearson ISBN 9780134254012

 

Tutorial information (teaching and help tutorials)

Teaching tutorials: Similar to lecture you will have material to learn the concepts at your own pace/time. This material will be available part way through the week of Jan 17 - 23. Look under 'content' in D2L and under the appropriate week for the tutorial you will find a separate folder for each tutorial.

Tutorial

Instructor

Contact information: if you have questions it's best to reach the TA during the CT time but you can email them for relative short and simple questions. Ali is the first person you should contact via email.
T01 Israa Farouk (Windows) israa.farouk1@ucalgary.ca
T02 Israa Farouk (Windows) israa.farouk1@ucalgary.ca
T03 Navid Akbari (MAC-OS) navid.akbari@ucalgary.ca
T04 Navid Akbari (MAC-OS) navid.akbari@ucalgary.ca
T05: Sean McCreary (MAC-OS) sean.mccreary@ucalgary.ca
T06  Kareem Abdelaty (Windows) kareem.abdelaty@ucalgary.ca
T07: Rylan Marianchuk (Windows) rylan.marianchuk@ucalgary.ca
T08: Rylan Marianchuk (Windows) rylan.marianchuk@ucalgary.ca
T09: Amir Aminbeidokhti (MAC-OS) amir.aminbeidokhti@ucalgary.ca
T10: Amir Aminbeidokhti (MAC-OS) amir.aminbeidokhti@ucalgary.ca

In addition to the Teaching Assistants who are assigned to teach a particular tutorial, for the distance learning version of this course funding was provided for an additional TA: Ali Shahidi. This person will be staffing many of the help tutorial times (Continuous Tutorial/CT) as well answering many of the email questions. If you have general questions about concepts or assignments then the first person you should email your question to is Ali before you contact your TA: ali.shahidi@ucalgary.ca. You can of course contact the course instructor for the 233 lectures. [Contact information]


Week Topics covered
Jan 17 - 23
  • Working through A0 with the TA.
  • TAs go over the requirements for mini-A1a.
  • TAs go over the requirements for mini-A1b.
  • Example programs for this week's tutorials.
  • Common and useful command line commands for Windows 'cmd'.
  • Review of downloading the JDK and setting Windows paths.
  • Displaying output, simple formatting of output.
  • Variables, named constants.
  • Getting text-based user input.
  • Branching: IF-structures, IF, ELSE-IF structures, compound Boolean expressions in conjunction with a logical operator.
  • Repetition: for, while, do-while loops, endless loops.
  • Pausing the program for user input.
Jan 24 - 30
  • Example programs for this week's tutorials.
  • Branching using the switch structure: how to properly define one properly and illustrating a common mistake when using a switch, java arrays, pre. vs. post operators.
  • Generating random numbers using class Random.
  • Creating basic Object-Oriented programs with multiple classes in multiple files.
  • Go over the requirements for A1.
  • Example techniques for debugging your programs.
  • Writing a program with a text-based user interface class (this will be a requirement for some of the later assignments).
Jan 31 - Feb 6
  • Example programs for this week's tutorials
  • Determining program requirements (loosely speaking = program features to be implemented) using Use Cases
  • Identifying candidate classes out of a requirements document.
  • Parameter passing in Java.
  • Defining wrapper classes
Feb 7 - 13
  • Example programs for this week's tutorials
  • TAs go over the requirements for A2
  • Working with "arrays of objects" (actually a reference to an array of references).
  • Understanding the difference between: static and final.
  • Determining attributes and methods of classes.
Feb 14 - 20 Reading week: no teaching
Feb 21 - 27
  • Example programs for this week's tutorials
  • Go over the requirements for mini-A3.
  • An application of static class variables: flags for program state (e.g. debugging mode).
  • Scope: attributes of classes, local variables and parameters.
  • Locals shadowing attributes.
  • Method overloading
  • The this reference and this()
  • Deep vs. shallow copy of arrays of 'objects': a more complex example with a more subtle error.
Feb 28 - Mar 6
  • TAs go over the requirements for A3
  • TAs will clarify what is and is not allowed in terms of helping others vs. academic misconduct.
Mar 7 - 13
  • Examples for this week's tutorials
  • Hierarchies Part I:
    • Inheritance relations between classes ("Is-a") relationships.
    • Protected level of access permissions.
    • Overloading methods between parent and child classes.
    • Assignment and casting within a without inheritance.
    • Scope: local, class, parent.
    • Reinforcing the importance of following good style conventions.

 

Mar 14 - 20
  • Examples for this week's tutorials
  • Hierarchies Part II:
    •  A more complex hierarchy involving overridden methods and the use of the keyword super
    • A more complex hierarchy involving overridden methods and the use of the keyword super
    • Interfaces, abstract classes, abstract methods and overridden non-abstract methods
    • Design: going from a paper description to UML class diagrams with abstract classes and methods.
  • TAs go over the requirements for mini-A4
Mar 21 - 27
  • TAs go over the requirements for A4
Mar 28 - Apr 3
  • Reference materials for this weeks tutorials: [Examples] [Exercises]
    • Graphical User Interface control: JButton, JFrame, JPanel
  • Illustrating how attributes and behaviors can be split among different classes within an Object-Oriented Hierarchy: [Hierarchical design of a past CPSC 219 assignment]
  • TAs go over the requirements for Mini-A5
Apr 4 - 10
  • TAs go over the requirements for A5
  • Reference materials for this weeks tutorials: [Examples] [Exercises]
  • Using common Java swing controls: JTextField, JTextArea, JPasswordField
  • A popup container: JDialog
  • Setting the layout of a GUI: manually and via the GridBagLayout/GridBagConstraints
  • Changing graphical attributes of components (color, image, font)
  • Creating components that include graphical icons (ImageIcon)
  • Making the container the event handling for graphical components
  • Defining anonymous classes and creating anonymous objects as event listeners
Apr 11 - 17 (last day of the term is Apr 15)
  • Reference materials for this weeks tutorials (note: not all examples are covered but you are free to browse them all): [Examples] [Exercises]
  • File input and output (using FileReader and BufferedReader) and output (using FileWriter and PrintWriter).
  • Simple recursive examples & exercises e.g. Fibonacci sequence, displaying a list in reverse order.
  • A more complex but useful application of recursion where backtracking is applied: finding the exit from a maze.
   

Help tutorials = Continuous tutorials (or CT for short) where you can go for help outside of class in addition to my office time. Each TA will have a separate Zoom link. CT commences the week of Jan 17 - 23. The number of hours vary according to the anticipated demand so check the schedule below for specifics.

Information on hiring a private tutor

Main grid: course schedule notes for the lecture, assignment information

Approximate time each topic will be covered in lecture Lecture topics & schedule
ABSOLUTE JAVA 6th edition [Help document for accessing the online book from the publisher]

Other textbooks on the online library website: [Safari]

Graded component due during the week: Note that all assignments are due at 4 PM
  Getting familiar with the computer science network Not applicable A0  (submitting files using D2L and checking submissions, not graded) closes off submission on Friday January 22.
Jan 10 - 16 Introduction to the course, administrative about how the course will be run such as grading information:
[Notes: pdf] [Notes: PowerPoint]

 

Basics of creating a Java program:
[Notes: pdf] [Notes: PowerPoint] [Examples]

Not applicable

 

 

Absolute Java: Chapter 1, Section 2.1, 2.2

 
Jan 17 - 23 Basics of creating a Java program Part 2 (branching, looping, generating random numbers, arrays):
[Notes: pdf] [Notes: PowerPoint] [Examples]

 

Introduction to Object-Oriented programming Part I (defining classes with attributes and methods, instantiating objects, calling methods inside and outside the definition of a class).
[Notes: pdf] [Notes: PowerPoint] [Examples]

Absolute Java: Chapter 3 (branches, loops, generating random numbers), Section 6.1 (simple arrays)  
Jan 24 - 30 Introduction to Object-Oriented programming Part II: learning the difference between functions vs. methods, defining accessor (set) and mutator (get) methods, overloading methods such as constructors.
[Notes: pdf] [Notes: PowerPoint] [Examples]

 

Introduction to Object-Oriented programming Part II: representing classes graphically using UML, why attributes are set to private, how to document classes, good style conventions for functions/methods.
[Notes: pdf] [Notes: PowerPoint] [Examples]

Absolute Java: Chapter 4. Things not to worry about yet:
  • 'this' parameter
  • 'equals()' method
  • 'toString()' method
  • recursive methods
Mini-A1a (Monday Jan 25)

Mini-A1b (Friday Jan 29)

Jan 31 - Feb 6 Advanced Java Part I: attributes vs. locals, formalizing scoping rules, shadowing attributes, relationships between classes and multiplicity
[Notes: pdf] [Notes: PowerPoint] [Examples]

 

Advanced Java Part II: references and objects, shallow vs. deep copies, automatic garbage collection, parameter passing
[Notes: pdf] [Notes: PowerPoint] [Examples]

Absolute Java: Chapter 4, refer back parts you previously skipped ('this' parameter, 'equals()' method, 'toString()' method)

Absolute Java: Chapter 5. Things you don't have to worry about yet:

  • Anonymous classes (covered with graphical user interfaces)
  • Mutable and immutable classes
  • Section 5.4
A1 (Friday Feb 5)
Feb 7 - 13 Advanced Java Part III: wrapper classes, array of objects
[Notes: pdf] [Notes: PowerPoint] [Examples]
  A2 (Friday Feb 12)

Extra guide for assignments: Common style and documentation problems found in A1 submissions.

Feb 14 - 20 Reading week: no teaching    
Feb 21 - 27 Advanced Java Part IV: static and final keywords, class constants and methods
[Notes: pdf] [Notes: PowerPoint] [Examples]
  Mini-A3 (Tuesday Feb 23)
Feb 28 - Mar 6 Advanced Java Part IV: The 'this' reference and 'this()'. Useful Java methods to implement: toString(), equals()
[Notes: pdf] [Notes: powerPoint] [Examples]

Introduction to problem solving:
[Notes: pdf] [Notes: PowerPoint] [Examples]

   
Mar 7 - 13 Object-Oriented Hierarchies Part I (Inheritance /"Is-a" relationships): method overriding vs. overloading, late vs. early binding, polymorphism, using the super keyword, protected level of access permission, updated scoping rules, the final keyword.
[Notes: pdf] [Notes: PowerPoint] [Examples]

Object-Oriented Hierarchies Part II Inheritance /"Is-a" relationships): the casting operator, the instanceof operator, class Object, multiple inheritance.
[Notes: pdf] [Notes: PowerPoint] [Examples]

  A3: Friday March 12

Practice A3: not graded but available to get O-O programming experience with a complex problem. [All PA3 resources]

 

Mar 14 - 20 Returning to A3, how inheritance may have been applied (not mandatory for the assignment). See the lecture video in D2L.
 

Object-Oriented Hierarchies Part III Interfaces and abstract classes):
[Notes: pdf] [Notes: PowerPoint] [Examples]

  MiniA4: Friday March 19
Mar 21 - 27 Graphical user interfaces Part I: event driven software, JFrame, JButton.
[Notes: pdf] [Notes: PowerPoint] [Examples]

Graphical user interfaces Part II: setting the layout manually and by using a layout manager class.
[Notes: pdf] [Notes: PowerPoint] [Examples]

   
Mar 28 - Apr 3

(Friday April 2 is the Good Friday holiday)

Graphical user interfaces Part III: controls affecting other controls, anonymous classes/objects, inner classes, setting physical and visual properties of GUI widgets, basis use of additional GUI controls: JTextField, JTextArea, JScrollBar, JPasswordField, JDialog.
[Notes: pdf] [Notes: PowerPoint] [Examples]

Graphical user interfaces Part IV: An introduction into designing "user friendly" software via Usability Heuristics.
[Notes: pdf] [Notes: PowerPoint]

  A4: Thursday April 1

Practice A4: not graded but available to get experience writing a program that includes inheritance (from 'hiearchies')  [All PA4 resources]

 

 

Apr 4 - 10 File input/output, exception handling:
[Notes: pdf] [Notes: PowerPoint] [Examples]

Recursion in Java:
[Notes: pdf] [Notes: PowerPoint] [Examples]

  Mini-A5: Monday April 5
Apr 11 - 17 (last day of the term is Apr 15) Design patterns and the history of Java:

(Design patterns)
[Notes: pdf] [Notes: PowerPoint] [Examples]

(Java history)
[Notes: pdf] [Notes: PowerPoint]

  A5: Tuesday April 13