TENTATIVE Schedule CS1110 – Fall 2016 – Dr. Kaminski (8/14/2016) week date (lecture) topics [changes to topics and topic-order posted on course website] readings (after 1st day, read book BEFORE lecture) (textbook section below – other material posted on course website] lab in-lab exercises, assignments & lab tests [NOTE: all 5 labs occur AFTER the 2 lectures each week Until after Thanksgiving] 1 Tues 9/6 intro to course / Java / NetBeans a simple Java Program Chap 1 Th/Fri/Mon 9/8 - 9/12 LabEx 1 [Java/NetBeans & installation, simple program, save/port project, submit work/asgns] Asgn 1 [~ 1.5 weeks] [1st program issues, hard-code input dialog box input, print to console, arithmetic] Thurs 9/8 PROGRAMMING BASICS parts of a simple Java program print & println (output) methods concatenate (+) operator variables, literals, primitive data types = (assignment) operator arithmetic operators, operator precedence algorithms & calculations 2.1 to 2.5 (to mid-page 62) 2 Tues 9/13 Q1 commenting, self-documenting naming input dialog box - JOptionPane convert string to int or double string vs. primitive data types briefly: a few String class methods combined asgn/arith operators casting, conversion % 2 (odd/even) 2.6, 2.7, 2.8, 2.9, 2.11 (to mid-page 79), 2.12, 2.14, 2.15 [later: 2.11 rest – doc commenting, 2.13 Scanner class] Th/Fri/Mon 9/15 – 9/19 LabEx 2 [Algor design, numeric computations, I/O, stacked if’s vs. if/else, add “trace” (println’s) to code] Asgn 2 [~2 weeks] [dialog box input. console output, printf (next week) for report, numeric computations, if/else, logical operators] Thurs 9/15 Q2 CONTROL STRUCTURES flow of control #1: decisions if, if/else, …, conditions Boolean conditions logical operators (&&, ||) operator precedence algorithm design using comments storage vs. immediate use of result 3.1 to 3.5 3 Tues 9/20 Q3 stacked vs. nested if/else switch (vs. if… else/if…) String class methods: comparing 2 strings build a String (String.format) convert string to char extract digits from a number (charAt, % /) formatted output printf method scope of variables floating point issues 2.10 3.6, 3.7, 3.9 to 3.11 Th/Fri/Mon 9/22 – 9/26 LabEx 3a [user input, extract digits from input number, printf for report, while loop for user input to do running total & ave.] LabEx 3b [using IDE’s interactive debugger] Continue work on Asgn Thurs 9/22 Q4 flow of control #2: looping (event-controlled) while loop [do/while loop] stacked vs. nested vs. controllers running totals, sentinels read/process vs. process/read loop structure 4.2 to 4.4, 4.6 [later: 3.8 conditional op] 4 Tues 9/27 NoQuiz flow of control #2: looping (count-controlled) for loop nested for loop comparing algorithms briefly: more String class methods & Math class methods & other classes (to convert String to …) 4.1, 4.5, 4.7, 4.9, 4.12 again: page 62 & 70, table 2-15, table 2-18 [later: 4.8 break & continue, 4.10 Files, 4.11 Random numbers] Th/Fri/Mon 9/29 – 10/3 LabEx 4a [for loops, nested for loops] LabEx 4b [modular design, method calling with parameters, Thurs 9/29 Q5 MODULAR PROGRAMMING flow of control #3: calling methods static methods input parameters & return values local variables, scope 5.1, 5.2 (to page 283), 5.3, 5.4, 5.6 [later: page 284-289 pass by value vs by ref., page 278 @param, page 306 exceptions] return values] Asgn 3 [~ 2 weeks] [modular programming, methods & controller, separate class (code file) for worker methods, parameters (& return values), reuse methods, switch] 5 Tues 10/4 Q6 More on methods methods in a separate class (code file) modular design problem-solving, algorithm design hierarchical calls pass by value, pass by reference self-documenting naming overloaded methods 5.2 (the rest), 5.5 4.8 Th/Fri/Mon 10/6 – 10/10 LabEx 5a [modular design, overloaded methods, separate class (file) for worker methods] LabEx 5b [Random number generator, min/max/total/ave., Use methods] Review for Lab Test 1 Continue work on Asgn Thurs 10/6 Q7 data stream from user data processing algorithm for a data stream: findMin/findMax, runningTotal, average Random number generator class data stream of random numbers 4.11 6 Tues 10/11 Q8 ARRAYS (STORAGE) data storage: array declare array, fill it with data parallel arrays algorithm: using for loops with arrays 7.1, 7.2 [later: page 422-424 copy array] Th/Fri/Mon 10/13 – 10/17 LAB Test 1 [assumes As1-3 & LabEx1-5 are done] [1st hour spent on lab test] Asgn 4 [~ 2.5 weeks] [modular program, parallel arrays, read data from user to fill arrays, calculate various stats (min/max/total/ave) including alphabetically 1st/last] Thurs 10/13 Q9 using arrays – various algorithms pass array to a method return array from a method pass by value, pass by reference issues specify array size at run-time special for loop for arrays review for midterm exam 7.3, 7.5, 7.14 5.2 (pages 284-288) 7 Tues 10/18 * * * E X A M * * * Exam includes up through Random numbers, but not arrays Th/Fri/Mon 10/20 – 10/24 LabEx 6 [parallel arrays, hard- code data (initializer lists of .csv strings), split needed to fill parallel arrays] Continue work on Asgn Thurs 10/20 Q10 partially-filled arrays (length vs. N) stored data (array) vs. data stream data processing algorithms for stored data: findMin/findMax, runningTotal, average more array algorithms: copy array reverse array, compare arrays String method: split for csv string 7.2 (pages 422-424), 7.4 (to mid-page 435), bottom-page 439 to mid-page 440), 7.14 [later: the rest of 7.4 objects, files] 8 Tues 10/25 Q11 String array 2-dimensional arrays, 3+ dim arrays rectangular vs. jagged (ragged) arrays Arrays class of methods: Arrays.sort, Arrays.copyTo 7.6, 7.9, 7.10 [later: 7.7 objects] Th/Fri/Mon 10/27 – 10/31 LabEx 7 [2D array, user specifies the total they want (specific row, specific col, whole table), overloaded methods] Asgn 5 [~ 2-weeks] [array, Arrays.sort, linear & binary searching, methods] Thurs 10/27 Q12 SEARCHING & SORTING (ARRAYS) algorithms: search array linear (sequential) search & binary search 7.8, 7.11 (binary search part) 9 Tues 11/1 Q13 Big O notation (Order of Complexity) re-using classes (methods) algorithms: sort array insertion sort & selection sort search/sort parallel arrays 7.11 (selection sort part) [later: 7.12 command-line arguments, …] Th/Fri/Mon 11/3 – 11/7 LabEx 8 [ArrayList] Continue work on Asgn Thurs 11/3 Q14 ArrayList class & its methods toString method 7.13 10 Tues 11/8 Q15 FILE I/O print to an output file read from an input file (EOF detection) Scanner class (for keyboard & file input) file as data stream (& processing algorithms) file-reading loop structures arrays & files 4.10 2.13 7.4 (pages 440-441) Th/Fri/Mon 11/10 – 11/14 LabEx 9 [Read from .csv file to fill parallel arrays, split method, skip specified records] Asgn 6 [~ 2.5? weeks] [OOP, input data file] Thurs 11/10 Q16 OBJECT-ORIENTED PROGRAMMING Object oriented programming (OOP) Classes & objects Object attributes and behaviors Instance variables & methods UML diagrams for class design Static vs. OOP classes 6.1 To 6.3 11 Tues 11/15 Q17 OOP core concepts: getters & setters (accessors & mutators) public / private constructor methods (calling, overloaded) toString & String.format method 6.4, 6.6, 6.10 8.4 Th/Fri/Mon 11/17 – 11/21 [i.e., Mon of Thanksgiving week] LabEx 10 [OOP, getters/setters, constructor, toString, methods] Continue work on Asgn Thurs 11/17 Q18 scope of variables & shadowing static variables this reference variable passing objects as parameters & returning objects from a method array of objects object is an array 6.5, 6.7, 6.9 7.4 (pages 435-439), 7.7 8.1 to 8.3,8.8 12 Tues 11/22 Q19 OOP topics continued Thurs/Fri 11/24 – 11/25 NO LAB Thurs/Fri NOTE: Mon LAB 11/21 was in week 11 above Thurs 11/24 THANKSGIVING (no WMU classes Wed noon – Fri) 13 Tues 11/29 Q20 sort/search array of objects 2 levels of objects ArrayList of objects object is a file NEW “LAB WEEK” Mon 11/28 (i.e., BEFORE the 2 lectures of the week) Th/Fri 12/1 – 12/2 (i.e., AFTER the 2 lectures of the week) Review for Lab Test 2 Asgn 7 [~1.5 weeks] [some of: array of objects, input data file] Thurs 12/1 Q21 MISCELLANEOUS TOPICS break & continue conditional operator char’s & their ASCII values exception handling (try/catch) DecimalFormat class Arrays class Javadoc comments 4.8 3.8 5.5 (page 306) 2.11 (page 79), 5.1 (page 278) 14 Tues 12/6 Q22 program calls a program, command-line arguments variable-length argument list recursion 7.12 NEW “LAB WEEK” Mon 12/5 Th/Fri 12/8 – 12/9 LAB Test 2 [assumes As1-6 & virtually all of As7 & LabEx1-10 are done] Continue work on Asgn Thurs 12/8 review for final exam 15 Wed 12/14 *** E X A M *** WEDNESDAY Dec 14 10:15am – 12:15pm Exam in lecture room D-109 (our regular classroom) NO LECTURES / LABS during exam week