Title: CSSE 2430 Object Oriented Programming and Data Structures I
1CS/SE 2430Object Oriented Programming andData
Structures I
- Instructor Qi Yang
- 213 Ullrich
- YangQ_at_uwplatt.edu
- 342-1418
2Web Sites
- My Home Page
- http//www.uwplatt.edu/yangq
- CS/SE 2430 Home Page
- http//www.uwplatt.edu/csse/courses/cs243/
3Course Description
- An introduction to object-oriented programming.
Emphasis on building and testing classes using
software engineering techniques. Includes study
of a standard class library and use of
inheritance and polymorphism for building
subclasses and extensibility. Coverage of the
stack and queue classical data structures.
Discussion of searching, sorting, and hashing
techniques. Introduction to linked lists. - Prereq COSC 1430
4Course Outcomes
- Upon completion of this course, students should
be able to - Develop software using elementary data structures
- Design, implement, and test programs using
classes, inheritance, and polymorphism - Compare and contrast algorithm efficiency at a
very basic level - Write module tests, system tests, and develop
test specifications - Perform simple object-oriented analysis and
design - Work in a small team (two or three people) on the
analysis, design, implementation, and testing of
a project.
5Course Work
- 6 Quizzes (Drop lowest) 50
- 6 Programs (labs) 140
- 3 Tests 210
- Final 100
- Total 500
- All programs MUST be completed to pass the
course. - Final Group 11 (7 pm, Wednesday, Dec. 16)
- Comprehensive
6Grading
- 450 500 A
- 400 449 B
- 350 399 C
- 300 349 D
- Below 300 F
- Auditing Students talk to me
7Tentative Test Schedule
- Test 1 Friday of Week 5
- Test 2 Friday of Week 10
- Test 3 Wednesday of Week 14
8Programs
- Individual Programs
- Limited help from others
- Program 1
- Group Programs
- Students in one group may get difference
scores - Programming Grand Rules
- Testing
- SE Tool for time log
9Labs
- Tuesdays
- Part of Programs
- Could lose points on programs
- Record of completion
- Lab 1 9 PM, Friday
10Additional Notes
- Do not miss class
- Do not miss lab
- Check UWP email every day
- Academic misconduct
- Religious observances
- Disability
- Talk to me!
11C and Java
- CS1430
- C
- Procedure programming
- CS/SE 2430
- Java
- Object Oriented Programming (OOP)
12C and Java
- CS1430
- HiC
- CS/SE 2430
- NetBeans 6.7
- DownLoad
- Install and Format
13Share Drive
- S\Course\CSSE\yangq\2430
- Individual folders
- (Drop Box)
- (Read Only)
- (Group folders)
14C and Java
- Primitive data types
- char
- ASCII and Unicode
- int, short, long
- float, double
- bool and boolean
- byte
15C and Java
- // Declaration statement
- int value, total 0, rem, quot
- value 5 // assignment
- if (value gt 0)
- total value
- else
-
- rem value 5
- quot value / 5
-
- // Statement terminator semicolon
16C and Java
- /
- Loops are the same.
- We could use it for comment in C.
- /
- int count 0, total 0
- while (count lt 100) // magic number
-
- count // same as count in most cases
- total count
17C and Java
- /
- For Loops are also the same
- We decided to use for comment start
- /
- for (int i 0 i lt size i )
-
- // Processing array elements
-
- // Output in C
- cout ltlt The value of i ltlt i
- // Out of scope!
- // Input/output in Java is
- // not as easy as in C!
18Arrays
- C
- int intArray50
- // Array of size 50
- // Index from 0 to 49
- // Same in Java
- for (int i 0 i lt 50 i )
- intArrayi i 10
Java // Array is a class int intArray // To
get an array object // Magic word new intArray
new int50 // Same as C for (int i 0 i lt
50 i ) intArrayi i 10
19Java Arrays
// Array is a class int intArray int index
0, size 50 intArray new intsize while
(index lt size) intArrayindex size
10 // same as // intArrayindex size
10 // index
20Java Arrays
int index 0, size 50 int intArray new
intsize intArray0 0 while (index lt size
- 1) intArrayindex size 10 //
same as // index // intArrayindex
size 10
21Warning
Never use or -- on an expression that appears
more than one in the statement.
intArrayindex index 10
intArrayindex-- index 10 // Dont do
it! x x x // Very bad! // Lose
Points!
22Arrays
Adding elements Deleting elements Linear
Search Computing max, min and avg Sorting
23C String
include ltstringgt using namespace std // data
type string is a class! string firstName,
lastName, str // any length cin gtgt firstName gtgt
lastName gtgt str if (firstName str) cout
ltlt str is the same as firstName! else
cout ltlt str has ltlt str.length() ltlt chars.
firstName CS/SE 2430
24Java String
// No include in Java, but import import
java.lang. // Not just for String // data
type String is a class! // All class names begin
with a capital char String firstName, lastName,
str // any length // Input is not as easy as in
C firstName new String(first) str
First // same as // str new
String(First)
25Java String
firstName new String(first) str First
if (firstName.equals(str))
System.out.println(str is the same as
firstName!) else System.out.println(str
has str.length() chars. firstName
str
26DeMorgans Law
- Logical Expression Same As
This? - !(cond1 cond2) (!cond1
!cond2) - !(cond1 cond2) (!cond1
!cond2) - Relational Operators
-
-
- !
27Program 1
- 15 points
- Individual assignment
- Demo in my office
- Time log
- SE_Tools at
- https//gamma.uwplatt.edu/SE_Tools
- Due 5 pm, September 9,
- Grace 5 pm, September 11
- Last demo at 445 pm
- Submit by 4 pm