Syllabus for EN.600.107: Introduction to Programming in Java Spring 2014 Course Information Instructor: Ben Mitchell Course dates: Monday, January 27 - Friday, May 2, 2014 Lecture times: Monday & Wednesday, 1:30 - 2:45pm Location: Schaffer 3 Course description: This course introduces fundamental structured and object-oriented programming concepts and techniques, using Java, and is intended for all who plan to use computer programming in their studies and careers. topics covered include vari- ables, arithmetic operators, control structures, arrays, functions, recursion, dynamic memory allocation, files, class usage and class writing. Program design and testing are also covered, in addition to more advanced object-oriented concepts including inheri- tance and exceptions as time permits. (http://www.cs.jhu.edu/~ben/cs107/) First-time programmers are strongly advised to take 600.108 concurrently. Prereq: familiarity with computers. Students may receive credit for 600.107 or 600.112, but not both. Required Textbook: We recommend the 2nd edition, but the first edition can also be used. The book is available at the JHU bookstore, as well as many online sources. You can also get this book in electronic format at http://www.coursemart.com. Introduction to Programming with Java: A Problem Solving Approach, Second Edition, John Dean & Raymond Dean, McGraw-Hill Higher Education, January 2013 ISBN-10: 007337606X ISBN-13: 978-0073376066 1 Recommended References: Some students like to have “reference” style books to sup- plement the long-form textbook. These are a few that are popular ones that are available for reading on-line through the MSE Library portal; just search for them at http://library.jhu.edu. Be sure to get the most recent edition. D. Flanagan, Java Examples in a Nutshell, O’Reily. Deitel & Deitel, Java How to Program, Prentice Hall. Arnold, Gosling & Holmes, The Java Programming Language, Addison-Wesley Professional. Course Topics: Basic programming concepts, including algorithms, variables, control struc- tures (decisions and loops), text file I/O, methods, classes, arrays, recursion, polymor- phism, and exceptions. We will not cover any GUI programming, though the class should prepare you to explore these topics on your own if you are interested. Course Outcomes: On successful completion if this course, students should be able to: • Understand the basic concepts and principles of structured programming. • Understand the basic concepts and principles of object oriented programming. • Produce sample use-cases, pseudocode, and an incremental coding plan for a given problem specification. • Design, write, and test a Java program to implement a solution to a given problem specification. • Understand the operation of common data structures and algorithms. Communications: The Course Website (http://cs.jhu.edu/~ben/cs107/) will be used for hosting course materials, including the syllabus and the homework assignment files, as well as linking to readings and useful references. Piazza (https://piazza.com/jhu/spring2014/en600107/home) will be used for all communications for this class. This includes important course announcements, as well being a place for posting questions and discussing course material. Direct communi- cation to the TAs or the instructor should be done by using “private” messages inside Piazza. Blackboard (https://blackboard.jhu.edu) will be used for assignment submission and feedback. All submissions must be done through Blackboard. Grades and assign- ment feedback will also be posted on Blackboard. 2 Instructor Information Name: Ben Mitchell Email: ben@cs.jhu.edu Website: http://cs.jhu.edu/~ben/ Office location: Croft (NEB) 217 Office hours: Mondays from 12:00-1:15 and 2:45-3:15, Wednesdays from 2:45-3:15pm, and Fridays from 1:15pm-3:15pm. Other times are by appointment; please e-mail the in- structor to schedule a meeting outside regular office hours. Biography: Ben is a Ph.D. candidate in the Computer Science department. His research in- terests lie in the fields of Artificial Intelligence and Machine Learning, with a particular focus on Deep Learning. Teaching Assistants Teaching assistants: TBA Office Hours: TBA Course Policies Announcement Policy Communications for this class will take place through Piazza. This includes important course announcements, as well being a place for posting questions and discussing course material. Direct communication to the TAs or the instructor should be done by using “private” messages inside Piazza. Homework Assignment Policy Expect to spend about 6-8 hours per week on reading and homework assign- ments. You will generally have two homework assignments due each week; a warmup exercise (usually due on Friday) and a program (usually due on Wednesday). Programs will be graded based on completeness, correctness, and style. No credit will be given for programs that do not compile. If a program is not working perfectly by the time the assignment is due, turn it in with a README and detailed comments explaining which parts are complete, and which are not, possibly including pseudo-code for un-implemented parts. It must still compile to receive any credit. No credit will be given for late assignments. 3 Extensions If a student is aware of extenuating circumstances that warrant an extension, a request for an extension can be made to the instructor. An extension request must have a good reason to be considered, and should be made well in advance if possible. Extensions requested after the time the assignment is due will be considered only in extreme circumstances. If an extension is granted, the normal penalties will not be applied until the granted extension period has lapsed. Exceptions can generally be made for serious illness, family emergencies, and the like. Exceptions will not be granted for poor planning & time management, or heavy workload. Assignment Reflections You may be asked to write a brief reflection on your assignments. Your reflections should be included as block comments at the end of your program file. Its presence will be a factor in your assignment grade, and should be at least a paragraph of well written English (full sentences, proper grammar, punctuation, spelling, etc.). Your reflection should comment on things like: How helpful was the warmup exercise? How difficult was the programming problem, and why? Where did you need help? How long did it take to complete? What was the best or worst part of the assignment? How would you re-design this assignment if you were the teacher? Computer Use & Logistics While many students prefer to program on their personal computers, all students should have access to the Krieger 160 computer lab. These machines should have everything students need to write and test their programs. However, be sure not to store files on public machines. Storing homework solutions on public machines is a serious violation of the ethics code. Instead, consider using a flash-drive to store your code so you can work on it from any computer. You are encouraged to use jGRASP for developing your programs; it is available on the machines in Krieger 160, and is freely available to download from http://www.jgrasp.org. It is a cross-platform Java development environment, with an emphasis on simplicity, and we will use it for in-class live coding demonstrations. All programs must compile using the standard Java compiler. This compiler is freely available through Oracle’s website for all platforms. Mac and Linux users may already have this installed; if not, it can often be installed through the platform package manager. You must use at least the Java 5 version; you will need the full Java Development Kit (JDK or SDK), not just the runtime environment (JRE). Assignments must be submitted through Blackboard. Always keep backups of every program you submit Attendance Events such as illness, injury, or job or graduate school interviews, are expected to occasion- ally prevent students from attending class. However, students who regularly fail to attend 4 lectures will be penalized (see the Grading policy). Baring these events, students are ex- pected to attend lecture regularly and promptly, and participate in any interactive exercises. Students are responsible for learning the material presented in class, and those who miss class are encouraged to read the relevant portions of the textbook, and come to Office Hours to discuss material they may have missed. If you have missed class, are having difficulty, or need extra help for any reason, please do not hesitate to contact the instructor, or any of the TAs or CAs. Students who fall behind have difficulty catching up, so it is better to ask for help sooner rather than later. Students who have flu-like symptoms are encouraged to stay home, and not attend class until they have been fever-free for 24 hours. The Student Health and Wellness Center does not issue notes for routine class absences, but will for missed mid-term examinations, final projects, etc. If you are sick and feel you need an extension on an assignment, make an extension request as a private post on Piazza. Collaboration All homework assignments are expected to be completed alone, unless otherwise noted. You may discuss general concepts and problems with your classmates, and you may work together on ungraded textbook-exercises. You must do all graded work on your own, and may not consult with other students on it. Homework assignments may only be discussed with the instructor, TAs and CAs, and tutors. Citations All sources used for homework assignments must be properly cited. This does not include class discussions or the assigned readings, but it does include any other outside sources such as non-assigned text books or internet sources. Failure to cite sources is plagiarism, and will be treated as such. Grading Policies Your course grade will be based on the following breakdown: Homework Assignments 40 % Midterm Exam, in class on Monday, March 3 20 % Final Exam, 9:00am on Wednesday, May 14 40 % Letter grades are subject to the instructor’s evaluation of overall class performance, but there will not be a curve. Questions or appeals about assignment grades should be directed to the head TA, and must be made within one week of the graded assignment being returned. If you are not satisfied with the TA’s resolution, you must submit a written appeal to the instructor via e-mail within two days of your discussion with the TA. 5 Ethics Policy See the department page and a copy of the JHU ethics handbook from the Academic Advising page (http://www.advising.jhu.edu/#procedures). Students violating the ethics code (eg. plagiarism, cheating, etc.) will be dealt with as specified in the ethics code. The policy for graduate students is slightly different, and can by found at http://engineering.jhu. edu/include/content/pdf-word/misconduct-policy.pdf and http://www.grad.jhu.edu/ downloads/MisconductPolicy06.pdf JHU Ethics Policy Synopsis The strength of the university depends on academic and personal integrity. In this course, you must be honest and truthful. Ethical violations include cheating on exams, plagiarism, reuse of assignments, improper use of the Internet and electronic devices, unauthorized collaboration, alteration of graded assignments, forgery and falsification, lying, facilitating academic dishonesty, and unfair competition. In addition, the specific ethics guidelines for this course are: Students may discuss high level concepts such as algorithms and techniques with one another to promote learning and understanding of course material. This is true even if there is a homework assignment based on the algorithm or technique in question. Students may not discuss details of solutions to assignments, nor is there to be any sharing or viewing of data, code, documentation, or other material created by someone else. Students may discuss anything related to the course with the course instructor or the course TAs/CAs. Both the instructor and the TAs/CAs will have regularly scheduled office hours, and will be available at other times by appointment. Students are expressly forbidden from any form of collaboration on work that is to be submitted for a grade unless explicitly given permission. Any assignment in which collaboration is allowed will be clearly marked with the scope of allowed collaboration (eg. no more than two students per group). On every exam, you will sign the following pledge: ”I agree to complete this exam without unauthorized assistance from any person, materials or device. [Signed and dated]”. Your course instructors will let you know where to find copies of old exams, if they are available. Report any violations you witness to the instructor. You may consult the associate dean of student affairs and/or the chairman of the Ethics Board beforehand. See the guide on “Academic Ethics for Undergraduates” and the Ethics Board Web site (http://ethics. jhu.edu) for more information. Disabilities Policy Any student with a disability who may need accommodations in this class must present the instructor with an accommodation letter from Student Disability Services, 385 Garland, (410) 516-4720, studentdisabilityservices@jhu.edu 6 Lesson Plan What follows is an approximate timeline for the course. We may deviate from this schedule based on the speed of our progress through material, as well as unforeseen disruptions (e.g. snowdays, etc.). Textbook chapter references are given in italics, and are for the 2nd edition of the text. References for the 1st edition appear in () where the two books differ. Related readings for each week are given in italics, and homework assignments are listed in bold. Week 1 (1/27, 1/29): Introduction Chapter 1 : Hardware, software, programming overview, course overview. Chapter 2 : Algorithms & Design Piazza sign-up, survey Week 2 (2/3, 2/5): Algorithms, Syntax, & Basic I/O Chapter 3 : Variables, arithmetic operators, constants, strings, statements, input and output. Chapter 12 (11): More on data types and operators. Install jGRASP, arithmetic warm-up Week 3 (2/10, 2/12): Decisions & Types Chapter 4 : Decision statements (if, if/else, switch), relational operators, boolean ex- pressions, comparing Strings. arithmetic programs, decision warm-up Week 4 (2/17, 2/19): Loops & File I/O Chapter 4 : Repetition statements (while, do/while, for), nesting. Chapter 16 (15): Input and output text files. decision program, loop warm-up Week 5 (2/24, 2/26): Writing Static Methods & Javadocs Chapter 5 : Math & Character classes, String & Random classes. Writing static meth- ods. Appendix 6 : Javadoc. Interlude (between chapters 5 and 6): Writing helper classes w/static methods. loop program, study for midterm 7 Week 6 (3/3, 3/5): Midterm Monday: Midterm on Chapters 1-4 & 11. Hangman development example study for midterm, methods warm-up Week 7 (3/10, 3/12): Writing Classes & Non-Static Methods Chapter 6 (7): Writing instantiable classes, accessors & mutators. Chapter 7 (8): Software engineering, helper methods. Chapter 8 (9): Class (static) variables & methods. files, random, methods program Spring Break Week 8 (3/24, 3/26): Primitive Arrays Chapter 9 (10): One dimensional arrays of primitives, two dimensional arrays, arrays of objects. class to match driver program, array warm-up Week 9 (3/31, 4/2): Classes with Arrays Chapter 9 (10): Classes with arrays, common array operations. 2D-array program Week 10 (4/7, 4/9): Array Algorithms Chapter 9 (10): Array algorithms: sorting & searching, analyzing performance. collection program warm-up Week 11 (4/14, 4/16): Recursion Chapter 11 (Appendix 8): Recursion. collection program Week 12 (4/21, 4/23): Polymorphism Chapter 13 & 14 (12 & 13), Appendix 7 : Interfaces, inheritance, OO Design. recursion program, polymorphic warm-up 8 Week 13 (4/28, 4/30): Exceptions Chapter 15 (14): Exception handling. Course wrap-up. polymorphic program Final Exam: 9:00am on Wednesday, May 14 The final concentrates on the last 2/3rds of the class material. 9