Enter Search Request 




Number of documents to retrieve
Sort type
WCU is a University of North Carolina Campus
 
CS 150 Syllabus

Problem Solving and Programming I

Revised: August 2008 (Mark Holliday)

Course Description

Problem-solving and algorithm development using an object-based programming language; classes, selection, iteration, arrays, and generic classes. 4 credit hours, required for major, required for minor, prerequisite or corequisite is MATH 146 or equivalent.

Objectives

  • Develop the ability to create non-trivial programs in an object-oriented programming language.
  • Develop the ability to create programs that contain method calls, multi-dimensional arrays, class definitions, inheritance, exception-handling, file input/output, and abstract classes and interfaces.
  • Develop the ability to use a program debugger to identify and correct syntax errors, logical errors, and semantic errors.

Text

Required: C. Horstmann, Core Java, Second Edition Wiley, 2006.
Required (depending on instructor): M. Holliday, CS 150 Lecture Notes, 2008.

Grading Procedure

Grading procedures and factors influencing course grade are left to the discretion of individual instructors, subject to general university policy.

Attendance Policy

Attendance policy is left to the discretion of individual instructors, subject to general university policy.

Course Outline

Part 1: Objects

  • Introduction to Java (3 days)
    Basic computer terminology, compilation, interpretation, byte code, rationale for the Java programming language. Mechanics of using the Java Development Kit (JDK).  A first Java program. Identifiers, statements, statement order, format, comments, references, sending a message (calling a method) to a predefined object of a predefined class. Reading: Chapters 1 and 2 of Horstmann and Chapter 1 of MH.
  • Using the String Class (3 days)
    Using the PrintStream and String classes. Methods, arguments, and return values, method signature and method prototype, reference variables, declaration and assignment statements, two reference variables may reference the same object, two objects may have the same state, String methods, method overloading, method cascading versus method composition. Reading: Chapter 2 of Horstmann and Chapter 2 of MH.
  • Using Classes (4 days)
    Creating objects with constructors, the File class, the FileOutputStream class, creating PrintStream objects, keyboard input, interactive input, disk file input, network input. Reading: Chapters 3 and 16 of Horstmann and Chapter 3 of MH.
  • Defining Classes  (5 days)
    Method and constructors headers and bodies. Arguments and parameters. Fields (instance variables). Return values and return statements. Access control (public versus private). Helper methods.  Reading: Chapter 3 of Hostmann and Chapter 4 of MH.

Part 2: Primitive Types, Expressions and Control Flow

  • Primitive Numerical Data Types (4 days)
    Primitive data type concept, the int type, arithmetic operators and expressions, literals and constants, precedence, increment and decrement operators, string objects and the + operator, other integer types, types for representing real numbers (float and double). Reading: Chapter 4 of Horstmann and Chapter 5 of MH.
  • Control Flow: Selection (3 days)
    If statement (two forms: with and without the else), relational operators and boolean expressions, multiway tests using if statements, nested if statements, dangling-else problem, switch statement, the null reserved work, the boolean data type, compound conditionals and logical operators, precedence with logical operators. Reading: Chapter 6 of Horstmann and Chapter 6 of MH.
  • Control Flow: Iteration (4 days)
    The while statement, designing loops, the for statement, the break statement, short-circuiting, the do-while statement. Reading: Chapter 7 of Horstmann of AW and Chapter 6 of MH.
  • More on Class Definition (4 days)
    Kinds of variables (parameters, local variables, and instance variables). Variable lifetime and scope. Order of constructor, method, and variable declaration. Static methods and static fields. Reference fields and reference parameters. Reading: Chapter 9 of Horstmann and Chapter 7 of MH .

Part 3: Testing and Arrays

  • Testing (1 day)
    Categories of errors, test drivers, incremental development, automatic testing, debugging techniques. Reading: Chapter 10 of Horstmann and Chapter 8 of MH.
  • Arrays (5 days)
    Declaring variables for one-dimensional arrays and creating one-dimensional array objects. Base type being primitive or object. Accessing an element of a one-dimensional array. The length field. Declaring variables for multi-dimensional arrays and creating multi-dimensional array objects. Accessing an element of a one-dimensional array. Row-major versus column-major traversal. A multi-dimensional array is really an array of arrays. Reading: Chapter 8 of Horstmann and Chapter 9 of MH.

Part 4: Advanced Topics

  • Inheritance and Interfaces (4 days, if time permits)
    Subclasses and the extends keyword. Superclasses and the super keyword. Accessing the superclass's state. Inheritance versus composition. Inheritance hierarchies, Object class, polymorphism, Object class, casting an object reference, abstract methods and abstract classes, interfaces. Reading: Chapter 11 and 13 of Horstmann and Chapter 10 of MH.
  • Vectors (2 days, if time permits)
    The Vector class, traversing a collection and the Enumeration class, methods of class Object (toString and equals). Wrapper classes. Indexing with vectors. Reading: Chapter 11 of MH.
  • Review (3 days)
Copyright 2009 by Western Carolina University       •     Cullowhee. NC 28723       •      Contact WCU
Maintained by the Office of Web Services       •      Map & Directions       •      Mapquest It       •      Emergency Information       •      Text-Only