WCU is a University of North Carolina campus
CS 150 Syllabus
Problem Solving and Programing I
Revised: November, 2009 (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.
Required: Objects First with Java: A Practical Introduction Using BlueJ, Fourth Edition, by David Barles and Michael Kölling, Pearson Education, 2009.
Grading ProcedureGrading procedures and factors influencing course grade are left to the discretion of individual instructors, subject to general university policy.
Attendance PolicyAttendance policy is left to the discretion of individual instructors, subject to general university policy.
Course Outline- 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: 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 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: 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 4 of MH. - 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 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 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 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 7 of MH . - Testing and Arrays
- Testing (1 day)
Categories of errors, test drivers, incremental development, automatic testing, debugging techniques. Reading: 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 9 of MH. - 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 10 of MH. - ArrayLists (2 days, if time permits)
The ArrayList class, traversing a collection and the Enumeration class, methods of class Object (toString and equals). Wrapper classes. Indexing with ArrayLists. Reading: Chapter 11 of MH.








