CISC 1115 Introduction to Programming Using Java
3 hours lecture, 2 hours lab; 4 credits
Algorithms, computers and programs. Writing, debugging, and testing programs.
Loops and conditional control structures. Method definition and parameter passing.
Arrays, ArrayLists, and Strings. Sorting, searching and other basic algorithms. Input
and output. Programming applications selected from various disciplines. History and
basic concepts of computer science.
Prerequisite: none
Contact hours: 5
By the end of this course, students should be able to:
Final Exam Day Sections Tuesday,Dec 20, 1:00-3:00PM Evening Sections Tuesday Dec 20, 6:00-8:00PM
(A) Basics
(1) Preliminaries
A basic model of actual computer systems and the internet
Computer terms
History of computing
Building software: programming languages, compilers, testing
Programmers and users
(2) Hello, World
Simple one method (main) programs
Standard output
String literals
Comments
(B) Arithmetic Calculations
(1) Numbers
Output (print/println) of, literals of, declarations of variables and associated operations of the int and double data types
Declaration initialization, final variables (constants)
Assignment operators, exchange (swap) algorithm, increment, and decrement
Distinction between integer and double arithmetic, divisibility, parity
Expressions, precedence, mixed arithmetic and casting
(2) Input and Output in Programs
Input using Scanner, methods: nextInt, nextDouble;
The import statement
Formatted output (printf)
(C) Other Types: Strings and Logical
(1) Strings
Output of, literals, declarations, and associated operations of String and their use (concat, length, substring (both forms), indexOf/lastIndexOf (both forms), trim, toUpperCase, toLowerCase, charAt, compareTo, equals)
Primitive vs Reference [Object] types: operator vs methods
The char data type
Input using Scanner, methods: next, nextLine;
(2) Logical
The boolean type; declaring boolean variables
Relational operators
Assigning to boolean variables; flags
Logical operators
The conditional operator
Range checking
(D) Methods
(1) Calling Static Methods
Invocation, arguments, and return values
Current time (System.currentTimeMillis)
Strings to ints/doubles: Integer.parseInt, etc.
The Math class and its methods (sqrt, random)
Composition
(2) Java API Documentation (System, Math, Scanner, String, PrintStream)
(3) Static Method Definition
Parameter declaration, return type, the return statement
Method scope
void methods
Predicate methods
(4) Overloading Methods; signature and prototype
(E) Control
(1) Branching
Compound statements
if, if—else
Cascading if—else
Nested if, if—else
(2) Loops
Counting loops: for
Testing loops: while
Loop body logic: selection, counting, accumulation, extremes, adjacency logic
Alternate testing loops: do—while
(3) Input Loops
Headers and counting loops (for)
Sentinel (aka "trailer") loops (while)
End of data loops (while and hasNext, hasNextInt, hasNextDouble)
(4) Nested Loops
(F) Arrays
(1) Basics:
Declaration of array reference variables
Creation and initialization of arrays
Array access
(2) Traversals:
Sequential Processing
Assignment, selection, counting, accumulation, extremes, adjacency logic
Reversals
(3) Array-array operations (copying, comparing, arithmetic element-to-element ops)
(4) Direct indexed array element access
(5) Searching:
Sequential
Binary
(6) Sorting: one or more simple quadratic sorts (selection, bubble, ...)
(G) External Files
(1) File names vs File objects vs File streams
(2) Scanner constructor with File object
(3) The importance of close
(H) Using the JAVA API Documentation
(1) File names vs File objects vs File streams