CS 240 Computer Science II Syllabus COMPUTER SCIENCE II CS 240 (in Java) Spring 2020 SYLLABUS Objectives Grading and Assignments Course policies Reading/ Homework This page last changed 4/23/20 Important Annoucement Regarding Remote Learning and Recording): Video and audio recordings of class lectures will be part of the classroom activity. The video and audio recording is used for educational use/purposes and may be made available to all students presently enrolled in the class. For purposes where the recordings will be used in future class session/lectures, any type of identifying information will be adequately removed from the videos. Due to Pennsylvanias Wiretap Law, we will be recording class sessions. By joining each class session, you consent to being recorded. More information about Pennsylvanias Wiretap Law is available at Recording Phone Calls and Conversations. Instructor: Gerald Kruse E-mail: kruse@juniata.edu Office location and phone: C-205A Brumbaugh Academic Center, (814) 641-3595 Office Hours are kept current on my home page. See the home page or my office door for recent changes; other office hours may be arranged by appointment. Computer Science help sessions are Su, Tu, and Th evenings at 7:00pm in C-102 in BAC. Class meeting times: M W F 01:30 - 02:40 in C109 BAC Required texts: Object-Oriented Data Structures Using Java - 4th Edition, Nell Dale, Daniel Joyce and Chip Weems ISBN-13: 978-1284089097 Recommended texts and resources: Any elementary Java programming text will serve as a language reference. Your CS 1 Java text Java: How to Program, Deitel & Deitel The JavaDoc API Pages Objectives: To develop skills in the design and development of computer software continuing to utilize an object-oriented language, packages, modules and libraries. To develop understanding and build skills in the implementation and use of common data structures used in software development through data abstraction. To further study the Java language. To build a basic background in algorithm analysis and verification techniques. To further understand various aspects of the field of computer science. Students will be able to program Java classes and methods based on modification. Students will learn how to use and manipulate several core data structures: Arrays, linked lists, trees, stacks, and queues. Students will advance their software development skills. This course's prerequisites are CS 110 - Computer Science I and MA 116 - Discrete Structures. You should bring skills in the following areas: build program solutions using control structures of selection (if-then, switch), iteration (while, for) and functions understand the use of objects, methods, and classes understand the basic use of vectors (arrays) understand the design, implementation and testing of small problem solutions (25-50 lines of code) a familiarity with graphs, trees, and other structures, and their associated mathematics A context for this course and those that follow in the CS and IT POE's are at this page. Grading: 75 pts Exam 01 - Mon 10.Feb 75 pts Exam 02 - Fri 28.Feb 50 pts Exam 03 - Fri 17.Apr 50 pts Exam 04 - During Final Exam time slot on Sat 09.May at 6:00pm 200 pts (approx.) Programming project, homework assignments, and in-class work. The points for each will vary depending on importance and effort required. Programming Help Sessions on Tu and Th 7-9pm C-102 25 pts Class Attendance, Conduct, and Professionalism Assignments and programs: Please note that programming projects which are not done with a “good faith” effort, especially those which have compiler errors, will receive minimal (if any) points. Programming projects, which are based on those in the text, will have their due dates and times announced in class and clearly marked on the assignment instructions. Projects may be done in pairs only when clearly designated on the assignment. The exercises listed below (as well as those given in class) should be attempted prior to the next class. Time will be available at the beginning of each class for questions on the exercises. Course policies My standard policies on attendance, late assignments, academic integrity, etc., are described on this web page. Please read them carefully. COMPUTER SCIENCE II TENTATIVE LECTURE/LAB OUTLINE This schedule is a work in progress. Assignments and lecture notes are under revision. Notes and outlines as linked below are based on materials from Prof. Loren Rhodes and the texts by Headington/Riley, Lambert/Osborne, Hahn, and Deitel/Deitel , and Dale/Joyce/Weems, which are copyrighted. Use of this material beyond the context of this course may infringe on the copyright of those texts. Assignment 06 due Lecture- Date Reading Topics/ Lecture Links Homework/ Programs/Exercises 01/22 Course overview; Software Process and Program Design, OO Java syntax overview In Moodle: 1. Review of Academic Integrity Policy and Course Syllabus 2. Student Info3. Java setup 01/24 Java overview Please have your JDE installed on your machine before class Java setup Java Basics Lab 00: Basic Java tasks Lab KEY Files Lab00Num01.java Lab00Num02.java Lab00Num03.java Lab00Num04.java Lab00Num05.java Lab00Num06.java 01/27 Sec 1.1 Java Overview (cont) and beginning Object Orientation Beginning Java Object-Orientation Car.java TDCar.java Assignment 01 Review questions 1.1: 3,9 01/29 Sec 1.2-3 Classes and objects in Java Exceptions Beginning Java Inheritance Hybrid.java TDHybrid.java Lab 01: Date Class Lab KEY Files Date.java DaysBetween.java Review questions 1.2: 16 Review questions1.3: 22 01/31 Sec 1.4 Data Structures and Simple Types Review questions 1.4: 27,28,29 02/03 Sec 1.5 Arrays and their operations Java 00 and Compilation Assignment 02 1. Create A02 Folder 2. Copy ch01 folder from book files to new folder. 3. Edit/create files in the ch01 folder as needed. Review questions 1.5: 30,31,32,34 02/05 Sec 1.6 Performance analysis, Big-O Big-O Exercises Review questions 1.6: 41,42,43 02/07 Sec 1.6 (cont) Performance analysis, Big-O (cont) Exam Review Big-O Estimations 02/10 Exam 01 Java Review and 1.1 - 1.6 Chapter 01 Review Slides 02/12 Sec 2.1 Abstraction and Implementation Garbage Collection (primitive vs. Object) Copy over Person.java from P:\Academic\kruse\cs240 Compile, then in the Interactions Pane, type: Person Bert = new Person ("Bert",34); Person Ernie = new Person ("Bert",34); if (Bert == Ernie) { System.out.println("Yes!"); } else { System.out.println("No"); } then try int n = 10; Person[] people = new Person[n]; for (int i=0; i < n; i++) { people[i] = new Person("Darth",40); } Lab 02: Exceptions Lab KEY Files UseDateExceptKEY.java DateExcepLabKEY.java DateOutOfBoundsException.java Review questions 2.1: 3, 4, 6, 8 02/14 Sec 2.2-2.4 Stacks and Implementations Assignment 03 Review questions 2.2-2.4: 12, 14, 19, 20 02/17 Sec 2.5 Classes and ArrayLists Review questions 2.5: 25, 26, 31 02/19 Sec 2.6 Array implementation of stacks Lab 03: Stack Applications Lab KEY Files TDBidArrayStack.java TDBidLLStack.java Assignment 04 (no late assignments accepted) Review questions 2.6: 35, 36, 37 02/21 Sec 2.8 Linked List Introduction Open your folder for A04, it has the LLNode.java code. Open the LLNode.java and LinkedStack.java, make sure they are compiled (there should be .class files) Open the "Interactions" pane in Dr. Java LLNode top; LLNode newNode1 = new LLNode("first"); top = newNode1; System.out.println(top.getInfo()); System.out.println(newNode1.getInfo()); LLNode newNode2 = new LLNode("second"); newNode1.setLink(newNode2); System.out.println(top.getLink().getInfo()); Review questions 2.7: 38, 39 Review questions 2.8: 43, 45, 46, 48 02/24 Sec 2.8 Linked List implementation of stacks A04 code demo/walk-around Review questions 2.8: 43, 45, 46, 48 02/26 Exam Review 02/28 Exam 02 1.6 - 2.8 Exam 02 Review Slides 03/02 Sec 2.9 Postfix Stack applications Review questions 2.9: 50, 51 03/04 Sec 3.1-3.2 Introduction to recursion Assignment 05 assigned Review questions 3.2: 4,5,6,7: 1 + 3 - 4 * 2 / 2 20 - ( 24 - 3 - 6 ) + ( 6 * 3 ) ( 43 + 4 ) * ( 12 - 6 ) / ( 7 / ( 24 + 10 ) ) ( ( ( 7 * 3 ) / 2 ) + 4 ) / 2 03/06 Sec 3.3-3.5 Recursion examples Towers of Hanoi Review questions 3.3-3.5: 10,11, 15 Spring Break Extended Spring Break 03/23 Sec 4.1-4.4 Queues and Queue applications Review: 4.1-4.4: 1,2,4,5,8,11 03/25 Sec 4.5-4.8 More on Queues Lab 04: Queue Simulation Queue Simulation KEY Review: 4.5-4.7: 19,20,23,26,27,31,33 03/27 Sec 4.9 Concurrency, Interference, Syncronization Threading in Java Assignment 05 due Assignment 06 assigned Review: 4.9: 44 Demo01.java Demo02.java Demo03.java Demo04.java Demo05.java Counter.java Increase.java IncreaseFromArray.java IncreaseSync.java SyncCounter.java 03/30 Sec 5.1-5.4 Collection ADT Review: 5.1-5.4: 3,6,7,15,16,19 04/01 Sec 5.5-5.7 List ADTs Review: 5.5-5.7: 23,25,27,28,29 04/03 Lab Day Assignment 06 due 04/06 Sec 6.1-6.2 Linked list implementation of lists Assignment 07 assignedReview: 6.1-6.2: 3,4,5,7,13 04/08 Sec 6.4-6.5 Linked Lists Plus Review 6.4-6.5: 31,34,36 04/10 Sec 7.1-7.2 Binary trees Review: 7.1-7.2: 4,6,9,12,13 04/13 Sec 7.3-7.6 Sec 7.7-7.8 Binary Search Tree Basics Binary tree operations A07 Logic Hints Review: 7.3-7.6: 18,22,37 Review: 7.7-7.8: 39,40ad,44,45 04/15 Sec 7.9-7.10 More on trees Exam 03 Review Slides Assignment 07 due Review: 7.10: 57 04/17 Exam 03 04/20 Sec 8.1-8.3 Maps and others http://docs.oracle.com/javase/8/docs/api/ Final Project assigned Scanner Lab Review: 8.1-8.8: 6, 15,16,20,25 04/22 Sec 8.4-8.7 Hash tables Pattern Lab 04/24 Sec 9.1-9.4 Priority Queues, Heaps Review : 9.1-9.4: 10,13,15 04/27 Sec 10.1-10.3 Graphs File Storage Hash Table Lab HashTableDemo.java HashTableDemoKEY.java Review: 10.1-10.3 7,8,10,11,16 04/29 Sec 11.1-11.2 N² sorting Review: 11.1-11.2: 7,8,9 05/01 Sec 11.3 Quicksorting Split in QS worksheet Review: 11.3-11.4: 11,21,30,31 05/01 Sec 11.3-11.5 Merging, mergesort et al Sorting, searching considerations Review: 11.3-11.4: 11,21,30,31 05/04 Review Exam 04 Review Slides Extra-material (Not on E04) File processing Collection Framework II data structure summary Saturday May 09, 6:00pm Exam 04 My homepage