Syllabus

Course Description

COS 126 introduces computer science through scientific, engineering, and commercial applications. You will learn fundamental principles and practical programming skills that prepare you to use computers effectively in fields such as computer science, physics, biology, chemistry, and engineering. The course uses Java to introduce fundamental programming concepts, including conditionals, loops, arrays, functions, and object-oriented programming. Additional topics include algorithms and data structures; principles of computation; hardware and software systems; and machine learning.

Course Communications

We use Ed Discussion for course announcements and the course discussion forum. Start there if you have a question; post publicly when possible and privately for personal matters. For office hours, Lab TAs, and other support options, see the Help page.

Textbook

Computer Science: An Interdisciplinary Approach, by Robert Sedgewick and Kevin Wayne. Addison–Wesley Professional, 2016. ISBN 978-0134076423.

We use this text throughout the semester; lectures and precepts follow it closely.

Course Organization

This course includes lectures, precepts, programming assignments, code reviews, a programming project, a midterm exam, a programming exam, and a final exam.

Lectures. Class meets twice per week. Lectures introduce new content and motivate the week’s topics.

  • iClickers. We use iClicker to make lectures more interactive. To earn participation credit, you must attend lecture and submit responses to at least 50% of the iClicker poll questions. You may not use a classmate’s iClicker or allow someone else to use yours.

  • Lecture recordings. We record lectures and post in Canvas. The system is set up not to capture student voices, but if you speak loudly it might be audible.

  • Lecture absences. The first four lecture absences are automatically waived. This accounts for illnesses, religious observances, varsity athletic competitions, late course enrollment, and technical issues with the iClicker app.

  • Waivers beyond the four waived absences. To request a participation waiver beyond the four waived absences, post privately on Ed with a brief explanation.

Precepts. Precepts meet twice per week. In a small group, your preceptor will review key learning objectives from the week’s lectures and lead interactive exercises and discussion, often in pairs.

  • Precept absences. The first four absences are automatically waived. This accounts for illnesses, religious observances, varsity athletic competitions, and late course enrollment.

  • Waivers beyond the four waived absences. To request a participation waiver beyond the four waived absences, post privately on Ed with a brief explanation.

  • Attending another precept. If you cannot attend your assigned precept, you may occasionally attend another precept. Notify both your regular preceptor and the preceptor you plan to visit.

  • Reviewing precept. If you miss a precept, see the materials on Ed Lessons.

Programming Assignments. There are ten programming assignments, equally weighted.

  • Late work. Assignments are due Sundays at 11:59pm ET. If any part of an assignment is submitted late, the entire assignment is late.

  • Late penalties. Late work receives a penalty of 10% of the assignment’s total points per day (or partial day).

  • Free late days. Your first four late days are automatically waived. This accounts for illnesses, religious observances, travel, and late course enrollment.

  • Extensions beyond the four free late days. Extensions beyond the four free late days require a documented medical or personal emergency and a recommendation from your Residential College Dean. To request one, post privately on Ed.

  • Late days and partners. If you work with a partner, late penalties apply to the group. The number of waived late days available to the group is the minimum number remaining among the partners.

  • Submission signal. We will not grade your submission until acknowledgments.txt is submitted. If you plan to submit late, do not submit that file until you are finished and ready for grading.

Code Reviews. You must attend two code review sessions (about 10–15 minutes each) to review your graded programming assignments, clarify feedback (grader comments, warnings, error messages, and deductions), and discuss style and design. You may be asked to explain your code.

  • Credit: credit is based on attendance and participation.
  • Sign-up: details forthcoming; sessions available only for Assignments 4–8.
  • Partners: for partner submissions, both partners must attend.

Programming Project. The project is a capstone that integrates topics from across the course. It is about the size of two programming assignments.

  • Partner: you are encouraged to work with a partner.
  • Late policy: late days may not be used on the project.

Exams. There are two in-class exams (a midterm and a programming exam), plus a final exam.

  • Midterm exam: in class on Wednesday, March 4.
  • Programming exam: in class on Wednesday, April 22.
  • Final exam: Wednesday, May 13, 12:30–3:30pm.
  • Rescheduling: Exams are rescheduled only in the event of a personal emergency. In-class exams requires a recommendation from a Residential College Dean and approval from the instructor. Final exam postponements require approval from the Registrar.

Regrades. If you believe your work was graded incorrectly (or your participation was recorded incorrectly), submit a regrade request within three days of the grade being posted:

  • Written exams: submit via Gradescope.
  • Programming exam/assignments: submit via codePost.
  • Lecture and precept participation: post privately on Ed.

Course Grades

Your course grade will be calculated based on a weighted sum of the programming assignments, code reviews, programming project, exams, and participation.

Component Weight
Programming Assignments 25%
Code Review 5%
Programming Project 5%
Midterm Exam 20%
Programming Exam 10%
Final Exam 30%
Participation 5%
Total 100%

Letter grades. Cutoffs are set at semester end and are not curved to a fixed distribution. The following thresholds guarantee at least the listed grade: A (93.0), A– (90.0), B+ (87.0), B (83.0), B– (80.0), C+ (77.0), C (73.0), C– (70.0), D (60.0). Grades are not rounded.

Course Collaboration Policy

This collaboration policy applies to all programming assignments and the project (both are referred to as “assignments” below). We encourage collaboration with course staff, classmates, and lab TAs, but only as permitted below. Here is an executive summary:

your partner course staff COS 126 alums COS 126 students generative AI other
discuss concepts with … yes yes yes yes yes yes
acknowledge collaboration with … yes yes yes yes yes yes
show your code/solutions to … yes yes yes no no no
view any code/solutions from … yes no no no no no
copy any code/solutions from … yes no no no no no

Concepts vs. assignment-specific code. You may discuss general concepts with classmates, but you may not discuss assignment-specific code. For example, you may discuss the syntax of a for loop or how to read a sequence of numbers, but you may not show, share, or review solution code with another student currently enrolled in COS 126.

Course materials. The course materials are sufficient to succeed in COS 126. They include the textbook and companion booksite, the course website, lecture slides, and precepts.

Using outside resources. You may use outside resources to clarify lecture, reading, precept, and past-exam material. If you learn a technique from an external source and apply it on an assignment, it must be within the scope of the course, and you must cite the source in acknowledgments.txt. Be cautious with AI-integrated tools: they may produce inaccurate, incomplete, or out-of-scope guidance.

Permitted resources for assignments. Once you start a programming assignment, you may use only course-approved resources. “Starting” includes reading the specification; downloading the project files; and any design, coding, debugging, or testing.

Collaboration with generative AI (GAI). You may not use generative AI for any part of a graded assessment in this course (programming assignments, the project, or exams). This includes using GAI to summarize specifications, generate solution ideas, write code, debug, add comments, or format work. This prohibition applies to general-purpose AI systems (e.g., ChatGPT, Gemini, and Claude), AI coding assistants (e.g., Copilot, Cursor, and JetBrains Assistant), and AI-assisted web search.

Rationale: A core learning outcome of COS 126 is developing your own problem-solving and programming skills. GAI can be helpful in many settings, but you must be able to reason about code and evaluate correctness independently. These skills are essential regardless of your major and will prepare you to use AI tools responsibly in later coursework and beyond.

If you are unsure whether a tool or use case is permitted, ask the course staff before using it.

Your solutions. You must compose your solutions independently. “Solutions” includes everything you create for a graded assessment, including source code (and comments) and readme.txt. It includes both draft and final work, whether correct or complete.

  • You may not share, expose, or make your solutions accessible to anyone who is taking COS 126 now or might take it in the future. Do not post solutions publicly (e.g., on a website or public repository), and do not leave printouts or files in shared locations. If you step away from your computer, lock it.
  • You may not access any solutions other than your own. This includes other students’ work, solutions found online, and code produced by Generative AI tools.

These rules remain in effect after the semester ends.

Collaboration with course staff. You may discuss your solutions with course staff (instructors and preceptors) during office hours or via private Ed posts. Do not post code on Ed or email us code. If we need to review your program, submit it on TigerFile.

Collaboration with COS 126 classmates. You are encouraged to discuss general concepts with classmates, either privately or on Ed. Keep these discussions at a general level and do not share, view, or review assignment solutions. If a classmate helps you, they must not look at their own solution while doing so.

For example, you may discuss: But, you may not:
How to interpret an error message. For example, “What does StackOverflowError mean?” Access a classmate’s solutions (or allow a classmate to access your solutions).
The meaning of a piece of Java syntax. For example, “What is the purpose of the clause Queue<String>”? Lead a classmate step-by-step through any part of the assignment (or allow a classmate to do the same for you).
How to use a feature in IntelliJ or bash. For example, “How do I start the embedded terminal?” Refer to your solutions while helping a classmate (or receive help from a classmate while they are referring to their solutions).
Clarifications for the lectures, textbook, or assignment specifications.
Solutions to book/booksite/precept exercises or old exam questions.

Collaboration with students who have already taken COS 126. Anyone who successfully completed COS 126 in a prior term, including lab TAs and peer tutors, may assist you under the following rules:

  • They must not look at any other solutions, including their own, while helping you.
  • They may look at your code.
  • They must not write, type, or dictate code.
  • They may help you debug, but they must not provide step-by-step directions for completing the assignment.
  • They should offer high-level, thought-provoking suggestions rather than telling you exactly what to change.

Collaboration acknowledgment. You must acknowledge all collaboration in acknowledgments.txt. Include the names and dates of any lab TAs, instructors, preceptors, and/or students who provided assistance. Also cite any outside resources you used.

Collaboration with a partner

Some assignments permit partnering. You are not required to partner, but we strongly recommend partnering on at least one partnered assignment. Pair programming helps you communicate about code, catch mistakes earlier, and often makes the work more efficient and less frustrating.

  • Group size. At most two partners per group.
  • Eligibility. Your partner must be a current COS 126 student (not necessarily in your precept).
  • Choosing a partner. The best experience is usually with a similarly skilled partner.
  • Switching partners. You may change partners between assignments.
  • Work together. Complete all work together while sharing one screen, including design, coding, debugging, testing, commenting, writing readme.txt and acknowledgments.txt, and submitting files.
  • No splitting. You may not divide tasks or work separately.
  • Help sessions. Attend office hours or the COS Lab together.
  • Pair-programming protocol. Use driver/navigator roles: the driver types; the navigator reviews, asks questions, and spots bugs. Swap roles about every 30 minutes.
  • Protect your work. Do not store or share code in a way that is accessible to anyone other than you and your partner. Shared private storage (e.g., Google Drive or Dropbox) is allowed.
  • Late days. Late penalties apply to the group. The number of waived late days available to the group is the minimum remaining among the partners.
  • Acknowledgment. In acknowledgments.txt, both partners must state that they followed the partnering rules.
  • Ending a partnership. To dissolve a partnership, contact the course administrator.

Plagiarism

Plagiarism and abetting plagiarism are serious academic violations. Programming is a creative work, and the standards that apply to plagiarized prose also apply to plagiarized code. Princeton’s Rights, Rules, Responsibilities defines plagiarism as using “the use of any outside source without proper acknowledgment.” This includes verbatim copying (e.g., copy-and-paste) and thorough paraphrasing (e.g., renaming variables or rearranging code).

Citations. If you copy or adapt any code, you must cite the source in acknowledgments.txt. A citation is not required for code taken directly from the assignment specification.

Plagiarism detection. We use software tools to flag submissions for review for potential plagiarism, including paraphrased code. We compare each submission (including interim submissions) against a database that includes submissions from this offering, prior offerings, and other sources. These checks may occur during the semester or after it ends.

Penalties. We refer alleged academic violations (e.g., plagiarism, abetting plagiarism, and failure to disclose the use of generative AI) to the Faculty–Student Committee on Discipline (CoD). We do not bring cases lightly, but we must keep the playing field fair for students who follow the rules.

If you are found responsible, you will receive a zero on the assignment, along with any additional penalties imposed by the CoD. Findings involving multiple assignments may result in more serious course penalties, including a failing course grade.

Regret clause. If you neglected to cite a source (or disclose the use of generative AI), you may update acknowledgments.txt at any time before Dean’s Date and notify the course staff. If you used an unauthorized source, you will likely receive a zero on the assignment for violating course policy. However, with proper acknowledgments, it is not plagiarism (or failure to disclose the use of generative AI), and we will not refer the case to the CoD. Once a CoD case has been submitted, the regret clause no longer applies.