CPTR 124
Fundamentals of Programming Winter 2020

Home Code Final Exam Study Guide Labs


Instructor

Rick Halterman

School of Computing
1117E Hickman Hall
Southern Adventist University
Collegedale, TN 37315-0370
423-236-2871

halterman@southern.edu
http://computing.southern.edu/halterman

Office Hours: http://computing.southern.edu/halterman/General/OfficeHours


Course Venue

HSC 3115    MWF 11:00–11:00 pm
HSC 1303    T 2:00–4:30pm or W 2:00–4:30 pm


Textbook

zybooks: CPTR 124: Fundamentals of Programming, available at https://learn.zybooks.com/zybook/SOUTHERNCPTR124HaltermanSpring2020

Instructions to access the textbook:

  1. Sign in or create an account at learn.zybooks.com
  2. Enter zyBook code
    SOUTHERNCPTR124HaltermanSpring2020
  3. Subscribe


Prerequisite

Math ACT ≥ 22 or Math SAT ≥ 520 or MATH 116 College Algebra, or permission of instructor


Purpose

Catalog description:

CPTR 124. Fundamentals of Programming 4 hours
Prerequisite: Math ACT ≥ 22 or Math SAT ≥ 520 or MATH 116 or permission of instructor.
Control structures, data types, data representation, compiling, debugging, modularity, and standard programming algorithms are introduced, using an object oriented language. Three hours of lecture and three hours of laboratory each week.

This course has three objectives:

  1. to develop the ability to correctly analyze a variety of problems and generate appropriate algorithmic solutions
  2. to explore the syntax and usage of the Java programming language as a means of accomplishing the first objective
  3. to examine the software development environment and associated tools.


Class Requirements and Grading

Class Work. The following class activities, weighted as indicated, determine the student's overall average for the course.

Activity Weight
Lab Assignments 20%
Reading Assignments 20%
Quizzes 20%
Midterm Examination 20%
Final Examination 20%

Grade Distribution. The overall average determines the course grade according to the following table:

Overall Average
(avg)
Letter
Grade
92 ≤ avg A
90 ≤ avg < 92   A–
88 ≤ avg < 90   B+
82 ≤ avg < 88 B
80 ≤ avg < 82   B–
78 ≤ avg < 80   C+
70 ≤ avg < 78 C
60 ≤ avg < 70   C–
58 ≤ avg < 60   D+
52 ≤ avg < 58 D
50 ≤ avg < 52  D–
avg < 50 F

CPTR 124 Fundamentals of Programming is a 4-hour course that includes an integrated laboratory component. As indicated above, the lab assignments contribute to the overall course grade.

Remarks

Reading assignments. The textbook is an interactive experience with embedded exercises that students complete as they read and study. The book provides more in-depth coverage of some of the finer details of the Java programming language than we have time to explore fully in our class meetings. Students accumulate points automatically as they read and answer the questions by the designated due dates. It is important to stay up to date in the course content, as the understanding of later concepts requires the mastery of earlier topics. To encourage students staying up to date in the reading, no points are available for a reading activity after its due date.

Laboratory assignments. Attendance at laboratory sessions is required, as this is a four credit-hour course. All lab assignments are due at the designated time and date. Late assignments will be penalized.

Ethics. As described above, a student's overall course grade is based on several factors: reading assignments, laboratory assignments, quizzes, and examinations. Each activity includes an expectation about a student's individual effort in the work produced. The following specifies the degree of collaboration permitted for each activity:

  • Quizzes. Each student must work individually on individual quizzes. This means collaboration in any way with others is not permitted. Some quizzes may be team based, in which case collaboration is limited to teammates. The instructor will clearly identify the team-based quizzes, if any.

  • Examinations. All examinations must represent individual effort; collaboration in any way with others is not permitted during examinations.

  • Reading Assignments. The textbook provides interactive exercises that enhance students' learning. Students should work individually on the reading assignments.

  • Laboratory Programming Assignments. Programming assignments present opportunities for students to explore programming concepts in a deeper, structured way. The programming assignments are not designed to be busy work or just another way to accumulate points for a grade but rather constitute the fundamental learning experience for this course. As such, the goal of the assignments is to sharpen students' problem-solving skills and build confidence in their programming ability.

    Ideally each student will develop his/her own logic and implement an assignment's solution with no help from others; however, such an experience is rare for most students because programming can be a difficult skill to master. Nonetheless, each assignment submission must represent individual effort. The instructor and lab assistant can provide immediate help during lab time. (Your experience in lab will be more valuable if to begin thinking about and begin working on the programming labs before lab time. This enables you to ask more focused questions.)

    It is important to understand that the experience gained from doing the assignments forms the basis for programming problems on examinations. The programming problems on examinations will not be exactly like the programming problems in the assignments, but the concepts required to create a correct solution will be similar. Unlike in many other courses, rote memorization is not generally very helpful for programming problems on examinations. You should not attempt to memorize snippets of code but rather seek to fully understand how the code works and how you might modify it to accomplish different tasks.

    The wrong kind of help can dilute the learning goals of the assignments and leave students less prepared for the examinations. The best kind of assistance to provide to a classmate that asks for help includes pointing out simple corrections or providing hints about how to structure a solution. Explaining to a classmate how a particular Java language feature works independent of its use within his/her program always is valuable. Helping a fellow student extinguish a puzzling error message also always is a good thing to do.

    Much less valuable help includes “I do not know what you are doing, but here, look at my code, this is how I did it.” Even worse is this: “I’ll email you my code so you can see how I did it.” Providing clues or hints to nudge a student in the right direction is much more beneficial to learning. Unfortunately, when presented with a complete solution, many students will take the easy way out and not put in the time necessary to understand completely how the code they were given works. This means they will complete the assignment but lack the full learning benefit the process was meant to provide.

    Unfortunately, technology makes it all too easy to share code and provide the kind of “help” that does not support the learning goals of this course. Because of its detrimental effect to the learning process, code sharing is prohibited. This includes allowing others to read your code in your editor window.

    It obviously is bad if you submit someone else’s work as your own, but, as is common in academic settings, knowingly enabling the opportunity for someone else to copy your work also is bad.

    Do not post your code on a public repository. Doing so can be too tempting to a fellow classmate looking for an easy way to complete an assignment without doing the work that provides the benefits of the exercise.

    Please take care as you are providing help to others. It IS okay to help others, and you SHOULD help others as you can, but giving others your code or doing their work for them is not really the help they need and is not allowed in this course.

    Those involved in allowing their programs, or parts of their programs, to be copied, or copying from other students' programs risk receiving a score of 0 on the assignment and a grade of F in the course.

    Incidents of academic dishonesty will be reported to the Associate Vice-president of Academic Affairs.

Class study. Appropriate study for the course includes reading the textbook and completing the reading activities by their due dates and experimenting with the programs from the book and programs we develop in class.

Quizzes encourage students to remain current in their class preparation. Quiz contents are based on material covered in the preceding classes and/or reading assignments. Quizzes may be given in class or on eClass. Missed quizzes may not be made up; however, the lowest quiz score will be dropped. Upon request, additional in-class quizzes may be dropped for students missing the quiz due to attending an off-campus trip officially approved by the Associate Vice President for Academic Administration.

Class decorum. Please comply with the standards of classroom attire as specified in the Student Handbook.  Notebook computers are welcome, and the classroom and lab (generally) have an excellent wireless signal.  You are welcome to take notes on your computer and edit the code that develop together in class. Students who wish to use their computers for activities not directly related to the class should sit in the rear of the class and mute their volume so as not to distract students behind them.  Electronic devices must be turned off during quizzes and tests.  You are expected to remain in the classroom during quizzes and tests, so be sure to take care of affairs (such as bathroom visits and tissue acquisition) before you sit for the quiz or test.

Examinations The dates for each test is listed in this syllabus. In certain situations, due to unavoidable circumstances, a missed test may be made up. Arrangements for the retake should be made before the time of the originally scheduled test. The make-up test may vary greatly in form from the original test, but its content (topics addressed) will be the same. Because of this difference, any points added (the so called "curve") to tests taken during the regularly scheduled time may not apply to retakes.

Please note the date and time for our final exam listed below. You need to plan to take your final exam at the scheduled time. Please make your work and vacation plans accordingly. Academic Administration will grant approval for variance from the published exam schedule only in cases of verified, serious, illness or a death in the immediate family. Academic Administration may, in case of exceptional and unavoidable circumstances, approve a variance, in consultation with the professor of this course. A $65 processing fee may be assessed.

Extra credit. Since the assigned material and activities are sufficient for most students, no extra credit will be available for additional work. However, well-prepared students wishing to enhance their learning experience beyond the class activities will be directed, upon request, to additional resources. Any such additional work will not influence the grade for this class.  

SAU account.  All students must have an active Southern Adventist University email account. This account is necessary to receive class messages and to be able to use the computers in the programming lab. You also should log into eclass daily to check for news updates pertaining to the course.

It is important that you check your southern.edu email account frequently (at least daily, if possible) so you you do not miss potentially important information about this course. Please use use your southern.edu email account when contacting the instructor; if you use a non-Southern account, your message may not make it through the University's spam filter.

Disability Statement. In keeping with the University’s policy, if you are a student who believes you may need an accommodation based on the impact of a disability or learning challenge, (i.e. physical, learning, psychological, ADHD or other type), you are strongly encouraged to contact Disability Support Services (DSS) at 423-236-2544 or stop by Lynn Wood Hall, Room 1082. Please note that accommodations are not retroactive and cannot be implemented until faculty or staff members have received the official Letter of Accommodation from DSS. Specific details of disabilities remain confidential between students and DSS unless a student chooses to disclose or there is legitimate academic need for disclosure, which is on a case-by-case basis. For further details, visit the Disability Support Services website at http://www.southern.edu/disabilitysupport.


Topics and Schedule

A list of topics with zyBooks sections follows. The scheduled due date for the reading activities appear in parentheses.

  1. Using Eclipse to develop Java Programs
    1. 0.1 Installing Java and the Eclipse IDE
    2. 0.2 Creating a Java project in Eclipse

  2. Introduction to Programming and Java (Due Jan. 20)
    1. 1.1 Programming (general)
    2. 1.2 Programming basics
    3. 1.3 Comments and whitespace
    4. 1.4 Errors and warnings
    5. 1.5 Computers and programs (general)
    6. 1.6 Computer tour
    7. 1.7 Language history

  3. Variables and Assignment (Due Jan. 27)
    1. 2.1 Variables and assignments (general)
    2. 2.2 Variables (int)
    3. 2.3 Identifiers
    4. 2.4 Arithmetic expressions (general)
    5. 2.5 Arithmetic expressions (int)
    6. 2.6 Example: Health data
    7. 2.7 Floating-point numbers (double)
    8. 2.8 Scientific notation for floating-point literals
    9. 2.9 Constant variables
    10. 2.10 Using math methods
    11. 2.11 Integer division and modulo
    12. 2.12 Type conversions
    13. 2.14 Characters
    14. 2.15 Strings
    15. 2.16 Integer overflow
    16. 2.17 Numeric data types
    17. 2.18 Random numbers
    18. 2.19 Reading API documentation
    19. 2.20 Debugging
    20. 2.21 Style guidelines

  4. Conditional Execution (Due Feb. 3)
    1. 3.1 If-else branches (general)
    2. 3.2 If-else
    3. 3.3 More if-else
    4. 3.4 Equality and relational operators
    5. 3.5 Detecting ranges (general)
    6. 3.6 Detecting ranges with if-else statements
    7. 3.7 Logical operators
    8. 3.8 Example: Toll calculation
    9. 3.9 Order of evaluation
    10. 3.10 Switch statements
    11. 3.11 Boolean data type
    12. 3.12 String comparisons
    13. 3.13 String access operations
    14. 3.14 Character operations
    15. 3.15 More string operations
    16. 3.16 Conditional expressions
    17. 3.17 Floating-point comparison
    18. 3.18 Short circuit evaluation
    19. 18.1 Do-while loops

  5. Iteration (Due Feb. 17)
    1. 4.1 Loops (general)
    2. 4.2 While loops
    3. 4.3 More while examples
    4. 4.4 For loops
    5. 4.5 More for loop examples
    6. 4.6 Loops and strings
    7. 4.7 Nested loops
    8. 4.8 Developing programs incrementally
    9. 4.9 Break and continue
    10. 4.10 Variable name scope
    11. 4.11 Enumerations

  6. Arrays (Due Feb. 24)
    1. 5.1 Array concept (general)
    2. 5.2 Arrays
    3. 5.3 Array iteration drill
    4. 5.4 Iterating through arrays
    5. 5.5 Multiple arrays
    6. 5.6 Swapping two variables (General)
    7. 5.7 Loop-modifying or copying/comparing arrays
    8. 5.8 Debugging example: Reversing an array
    9. 5.9 Two-dimensional arrays
    10. 5.10 Enhanced for loop: Arrays
    11. 14.1 Enhanced for loop

  7. Custom Methods (Due Mar. 2)
    1. 6.1 User-defined method basics
    2. 6.2 Return
    3. 6.3 Reasons for defining methods
    4. 6.4 Methods with branches/loops
    5. 6.5 Unit testing (methods)
    6. 6.6 How methods work
    7. 6.7 Methods: Common errors
    8. 6.8 Array parameters
    9. 6.9 Scope of variable/method definitions
    10. 6.10 Method name overloading
    11. 6.11 Parameter error checking
    12. 6.12 Using Scanner in methods
    13. 6.13 Perfect size arrays
    14. 6.14 Oversize arrays
    15. 6.15 Methods with oversize arrays
    16. 6.16 Comparing perfect size and oversize arrays
    17. 6.17 Using references in methods
    18. 6.18 Returning arrays from methods
    19. 6.19 Common errors: Methods and arrays
    20. 6.20 Java documentation for methods

  8. Recursion and Array Manipulation (Due Mar. 9)
    1. 11.1 Recursion: Introduction
    2. 11.2 Recursive methods
    3. 11.3 Recursive algorithm: Search
    4. 11.4 Adding output statements for debugging
    5. 11.5 Creating a recursive method
    6. 11.6 Recursive math methods
    7. 11.7 Recursive exploration of all possibilities
    8. 11.8 Stack overflow
    9. 17.1 Searching and algorithms
    10. 17.2 Binary search
    11. 17.5 Sorting: Introduction
    12. 17.6 Selection sort

  9. Objects and Classes, Part 1 (Due Mar. 23)
    1. 7.1 Objects: Introduction
    2. 7.2 Using a class
    3. 7.3 Defining a class
    4. 7.4 Mutators, accessors, and private helpers
    5. 7.5 Initialization and constructors
    6. 7.6 Choosing classes to create
    7. 7.7 Defining main() in a programmer-defined class
    8. 7.8 Unit testing (classes)
    9. 7.9 Constructor overloading
    10. 7.10 Objects and references

  10. Objects and Classes, Part 2 (Due Mar. 30)
    1. 7.11 The 'this' implicit parameter
    2. 7.12 Primitive and reference types
    3. 7.13 Wrapper class conversions
    4. 7.14 ArrayList
    5. 7.15 Classes and ArrayLists
    6. 7.16 ArrayList ADT
    7. 7.17 Java documentation for classes
    8. 7.18 Parameters of reference types
    9. 7.19 Static fields and methods
    10. 7.20 Using packages

  11. Memory Management (Due Apr. 6)
    1. 8.1 Introduction to memory management
    2. 8.2 A first linked list
    3. 8.3 Memory regions: Heap/Stack
    4. 8.4 Basic garbage collection
    5. 8.5 Garbage collection and variable scope

  12. Inheritance (Due Apr. 13)
    1. 10.1 Derived classes
    2. 10.2 Access by members of derived classes
    3. 10.3 Overriding member methods
    4. 10.4 The Object class
    5. 10.5 Polymorphism
    6. 10.6 ArrayLists of Objects
    7. 10.7 Abstract classes: Introduction (generic)
    8. 10.8 Abstract classes
    9. 10.9 Is-a versus has-a relationships
    10. 10.10 UML
    11. 10.11 Interfaces

  13. Exceptions (Due Apr. 20)
    1. 12.1 Exception basics
    2. 12.2 Exceptions with methods
    3. 12.3 Multiple handlers
    4. 12.4 Exception handling in file input/output

  14. Generics (Due Apr. 27)
    1. 13.1 Comparable Interface: Sorting an ArrayList
    2. 13.2 Generic methods
    3. 13.3 Class generics
    4. 14.2 List: LinkedList
    5. 14.3 Map: HashMap
    6. 14.4 Set: HashSet


Important Dates

  • January 13 First day of class
  • January 20 MLK Jr. Day (No class)
  • January 22 Last day to drop and not receive a W
  • March 4 Midterm examination
  • March 13–20 Spring break (No classes)
  • March 26 Last day to drop and receive a W
  • May 4 Midterm examination at noon


Class Code

Code we develop in class is available at https://github.com/halterman/124_W20