DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE



DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE

Coppin State University

Baltimore, Maryland 21216

COURSE SYLLABUS

(REVISED JANUARY 2007)

COSC 220 COMPUTER SCIENCE I 4 CREDITS

General Information

1. Semester : SPRING 2007

2. Course number : COSC 220.001

3. Course name : COMPUTER SCIENCE I

4. Credits : 4 credits

5. Meeting Time : MTWRF 10:00AM - 10:50AM

6. Room : PM 002 (LIBRARY)

7. Instructor : E. Sommerfeldt

8. Office : GJ 607

9. Office Telephone : 410-951-3479

10. Office Hours : MTWR 11:00AM - 12:45PM

F 11:00AM - 11:50AM

01:00PM - 01:45PM

OTHER HOURS BY APPOINTMENT

11. FINAL EXAMINATION:

Date : Monday, May 21, 2007

Time : 10:00AM – 11:50AM

Place: GJ 26, The Classroom

Course Description: This course is a continuation of COSC 199, Introduction To Computer Programming, which uses the Java language as a vehicle to teach skills relevant to sound professional programming. Topics include: looping, methods, text files, arrays, searches, sorts, records, pointers, recursion, and Java classes.

Prerequisite: Successful completion (C or Better) of COSC 199 or permission of instructor.

Required Text

Tony Gaddis; Starting out With JAVA 5, from control structures to objects; Scott Jones, Inc; 2005; ISBN 1-57676-171-1

COURSE OBJECTIVES: Upon completing this course, the student will be able to:

1. utilize logical operators and DeMorgan's laws to construct semantically accurate Java Boolean expressions.

2. construct if statements, multiple-test conditionals using if...else, and switch statements to perform specific branching tasks.

3. trace if...else statements to determine the correct output.

a. Be able to determine which else corresponds to which if even if the indenting is misleading.

b. Recognize that an if and its corresponding else must be in the same block. Therefore, when an if appears in a block by itself, it has no corresponding else.

c. Recognize and be able to use the Boolean operator && (AND) and the Boolean operator || (OR) with if statements.

d. Be able to determine which statements are subordinate to an if (and an else) and which are not. For a series of statements to be subordinate to an if (or an else), the statements must be enclosed within braces.

4. construct while loops, for loops, do...while loops, and nested loops to perform specific tasks.

5. to trace while loops to determine the output

a. Count-controlled loops which print counts from one integer to another

(1) Counting consecutively

(2) Counting odd numbers

(3) Counting even numbers

b. Count-controlled loops which read a data values and add them

c. Count-controlled loops which read data values and finds the largest.

d. Count-controlled loops which read data values and finds the smallest.

e. Count-controlled loops which counts the number of times a value occurs in the input stream ( or how many are less than a specific value, or greater than a specific value)

6. explain the difference between a pretest loop and a posttest loop.

7. write Java methods that have simple and/or array arguments, explain how the computer implements passing arguments to methods, explain how arguments make methods more flexible and convenient.

8. write Java methods that return results and create a personal method library.

9. discuss and implement method overloading in Java

10. implement standard techniques for computing sums and products.

11. apply the top-down design methodology to solve a problem, code top-down designs in Java and write programs that get program data from external input files and send processed results to external output files.

12. write Java code to declare, and access one-dimensional arrays in Java

a. Be able to Initialize one-dimensional arrays in the declaration.

b. Be able to Initialize one-dimensional arrays using a for loop.

c. Be able to write a method to read data from a file, insert it into a one-dimensional array, and return the count of the number of items read.

13. write

a. a linear search method for a sorted or an unsorted array of integers

b. a binary search method for a sorted array of integers.

c. at least one sorting method (bubble, insertion, selection, or shell sort.)

14. make the minimal changes required for the method to handle an array containing a more complex data type given a method written to handle searching or sorting an array of integers,

15. identify real life application problems which can be solved using one-dimensional arrays, develop an algorithm to solve the problem and code it in Java.

16. write Java code to declare, and access two-dimensional arrays in Java

a. be able to process a two-dimensional array (matrix) by row:

(1) to fill the matrix from a file by row

(2) to print the matrix by row

(3) to sum the rows and print the row sums adjacent to the row

(4) to swap two rows of the matrix

b. be able to process a two-dimensional array (matrix) by column:

(1) to fill the matrix from a file by column

(2) to print the array by column

(3) to Sum the columns and print the column sum beneath the column.

(4) to swap two columns of the matrix

17. search a two dimensional array for the first occurrence of a value or the last occurrence of a value

18. write an algorithm to sort a two dimensional array using an intermediate one-dimensional array and its sorting method.

19. develop and implement an algorithm to sorting a two dimensional array directly.

20. explain the principle of recursion, trace recursive algorithms to determine the correct output, design correct recursive algorithms, and program recursive algorithms in Java.

21. use a Java class structure to encapsulate data with its corresponding methods.

COURSE OUTLINE

Review of Control Structures

The if Statement

The if-else Statement

The if-else-if Statement

Nested if Statements

Logical Operators

Comparing String Objects

More about Variable Declaration and Scope

The Conditional Operator (Optional)

The switch Statement

Creating Objects with the DecimalFormat Class

The printf Method

Review of Loops and Files

The Increment and Decrement Operators

The while Loop

Using the while Loop for Input Validation

The do-while Loop

The for Loop

Running Totals and Sentinel Values

Nested Loops

The break and continue Statements (Optional)

Deciding Which Loop to Use

Introduction to File Input and Output

Methods

Introduction to Methods

Passing Arguments to a Method

More about Local Variables

Returning a Value from a Method

Problem Solving with Methods

A First Look at Classes

Classes and Objects

Instance Fields and Methods

Constructors

Overloading Methods and Constructors

Scope of Instance Fields

Packages and import Statements

Focus on Object-Oriented Design: Finding the Classes and Their Responsibilities

Arrays and the ArrayList Class

Introduction to Arrays

Processing Array Elements

Passing Arrays As Arguments to Methods

Some Useful Array Algorithms and Operations

Returning Arrays from Methods

String Arrays

Arrays of Objects

The Sequential Search Algorithm

Two-Dimensional Arrays

Arrays with Three or More Dimensions

The Selection Sort and the Binary Search Algorithms

Command-Line Arguments and Variable-Length Argument Lists

The ArrayList Class

A Second Look at Classes and Objects

Static Class Members

Passing Objects As Arguments to Methods

Returning Objects from Methods

The toString Method

Writing an equals Method

Methods That Copy Objects

Aggregation

The this Reference Variable

Enumerated Types

Garbage Collection

Focus on Object-Oriented Design: Class Collaboration

Recursion

Introduction to Recursion

Solving Problems with Recursion

Examples of Recursive Methods

A Recursive Binary Search Method

The Towers of Hanoi

Modes Of Instruction : Various modes of instruction will be used. These include lecture, computer demonstrations, and small group discussions. Additionally, Tegrity will be used to record class lectures for students to review over the internet using Blackboard.

Class Notes and Notebook

Organization and neatness are essential qualities of a successful college student. Therefore, your notebook should reflect these qualities. It should be divided into two sections: (1) Classnotes and (2) Problem Sets. Notes for each day should contain the TOPIC and DATE. Problem sets must carry the identifying information explained and illustrated above.

2. Notebooks will be collected from time to time.

Home Assignment Problem Sets

1. A set of problems will be given each class period. These problems will provide practice on concepts explained and procedures demonstrated during in-class discussions.

2. In your notebook, each assigned set must posses IDENTIFYING INFORMATION. The textbook SECTION, the textbook TOPIC, the exercise PAGE NUMBER, the numbers of the ASSIGNED PROBLEMS, and YOUR NAME must appear at the top of each exercise set. An example appears below.

Jane Doe

Chapter 1: Exercise 1.1 Introduction To Computing Systems.

pp. 8-9 Concepts Check # 1-8

p. 9. Set A # 15, 19, 20

3. During the first several minutes (approximately 10 minutes) of class, questions on the previous problem set will be discussed. Some problems will not be worked completely. Enough of a hint will be given so that you might proceed with the solution. If the hint is not sufficient, then make an appointment to see the instructor during an office hour.

4. Quizzes will be given periodically. Each quiz will consist of four (4) or more questions selected from among those assigned as home assignment problems.

5. Problems sets will be periodically collected and graded. Therefore all home assignments must be neatly completed on time. Two or more sheets must be secured by a staple or paper clip.

6. Problem sets collected at the beginning of class and late assignments will not be accepted.

Class Rules and Regulations

1. Smoking, eating, and drinking are prohibited in class.

2. Attendance policy rules are strictly enforced. Regular attendance at class and punctuality in arriving for class are required. IT IS THE RESPONSIBILITY OF THE STUDENT NOT TO SCHEDULE ANY ACTIVITY WHICH MIGHT INTERFERE WITH CLASS HOURS.

3. The maximum number of unexcused absences that will be tolerated for this course is five (6). Six or more unexcused absences will result in either administrative withdrawal from the course or a grade of F for the course. If you find that you cannot come to class regularly, make an appointment with or call the instructor.

4. Attendance will be taken at the beginning of class. Any student not present when roll is called will be marked absent. If you are late, remember to check with the instructor at the end of class; otherwise, you will be marked absent.

5. When you are absent, call a classmate or the instructor (during a posted office hour) to determine what new material was covered and to obtain the home assignment.

Classmate's Name : Phone :

6. Tests will be announced in advance; quizzes may be unannounced. Makeup tests will ordinarily not be given. Exceptions to this rule will be made only in the event that the student presents convincing evidence that he/she had a valid reason for missing the exam. It is, therefore, imperative that you be present on the day of the examination.

Evaluation: Students will be evaluated based upon their performance on tests/exams and programming assignments and other assigned problems.

1. The student will receive a final grade of:

A. . . 90 - 100

B. . . 80 - 89

C. . . 70 - 79

D. . . 60 - 69

F. . . Below 60

2. Tests and Quizzes : 50% of Course Grade

a. Approximately five tests and seven quizzes will be given. Tests will last 50 minutes and quizzes, no more than 10 minutes. Quizzes will be administered at the beginning of class. A student who arrives late will have the remainder of the 10 minutes to complete the quiz. A student who arrives too late to take the quiz will receive a grade of zero for that quiz.

b. A set of four (3) quiz grades will be averaged to give one test grade.

3. Programming Assignments : 25% of Course Grade

a. Approximately ten (10) programming assignments will be given during the semester.

b. Each program is due on the date specified. Late assignments will not be accepted.

4. Home Assignment Problem Sets: 5 % of Course Grade

5. Final Examination: 20 % of Course Grade

6. The following formula will generate your grade for the course:

COURSE GRADE = .50(AV) + .25(PRG) + .05(PS) + .20(FE)

WHERE

AV = Average of Tests/Quizzes

PRG = Average of Programming Assignments

PS = Average of Home Assignment Problem Sets

FE = Grade on Final Exam

7. Please keep a record of your grades so that you will always be able to calculate your current average.

COURSE WRITING POLICY The following policies are in effect for this course.

1. Each in-class examination will include at least one question requiring a written response.

2. At least one out-of-class writing assignment will be required of all students in this course.

3. All examination questions which required a written response and all other writing assignments will be graded on the basis of the quality of the writing (i.e.,mechanics, style, organization, development) as will as content.

4. Supplementary texts for this course include the English handbook and Webster's Ninth New Collegiate Dictionary.

5. Academic Honesty is required of all students at all times.

Perhaps the worst violation of honesty in any kind of writing is plagiarism-using someone else's words, facts, or ideas without giving proper credit. It will be taken for granted that any work, oral or written, that a student does for this course is his/her original work. Any violation of this rule constitutes plagiarism. Plagiarism includes any form of cheating on examinations, tests, or quizzes, and unacknowledged/undocumented use of another's writing or ideas, including copying another student's programming assignment. A student who plagiarizes will receive an F for the project..

6. All written assignments must bear adequate identification on the outside of the paper, including name, course title, section, and date. The title must be centered on the top line of the first page; each page must be numbered; and pages must be attached in the manner prescribed by the instructor. A handwritten assignment must be completed on white paper; it must be legible; and there should be no writing on the back of the paper.

Java STYLE RULES

When entering a Java program into the editor, you must utilize the following style rules so that your program will be easy to read and correct. For a program that is otherwise correct and error free, violations of these rules can reduce the grade by as much as 20%.

1. CAPITALIZATION:

a. Java is a "case sensitive" language, thus two identifiers such as "Num" and "num" are considered different identifiers by the compiler.

b. All Java reserved words must be typed exactly as they appear in lower case.

c. Constants defined using the final keyword must be typed in uppercase.

d. Names of methods can use both upper and lower case letters. You should use an uppercase letter to begin the name of a method and break up long names into words. A method named "GetTotalValue" is an example.

e. Characters in comments and within strings may be capitalized at the discretion of the programmer.

f. All other words must be typed in lower case.

2. IDENTIFIERS: The name of (constant, variable, method and type) identifiers must be mnemonic; that is, the name of the identifier should describe its purpose. For example, it is syntactically and stylistically appropriate to name a method "get_data"; whereas, it is syntactically acceptable but stylistically unacceptable to name a method "X."

3. USE OF CONSTANTS: To make your program easy to modify, avoid the use of explicit numeric values whenever possible. It would be better to define symbolic constants for explicit numeric values using the #define preprocessor directive or by using the final statement. For example, we could define

final int LOW = 10;

const int HIGH = 50;

to transform the statement,

for (k = 1; k ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download