Table of Contents
- Overview
- Tips
- Getting Started
- Written Questions
- Testing and Debugging
- Style Guide
- Projects
- Grading
- Regrades
- Late Assignments
- Collaboration and Academic Integrity
Overview
We know that a lot goes into a CS11 homework assignment, and much of it is unfamiliar to students who are new to coding at Tufts. This document is meant to give a general overview of the homework policies and help you get accustomed to the course.
All homework assignments will go out and are due as described on the course calendar. Any last minute updates about assignments or due dates will happen on Piazza
Tips
- Read the Whole Assignment: Before starting, it is always a good idea to read through the whole assignment so you can begin to plan your solutions. We often recommend students reading through the specification (spec) the day homework is released even if you don't have time to start for a few days. Programming problems often take time to think about and plan. By reading the problems, you can be working on them in the background and it often makes the assignment significantly easier and faster once you begin the actual work.
- Start Early: Not only will starting early give you time for unexpected problems, it is also significantly easier to get help in office hours earlier in the week because it will be less crowded. It is hard, especially when first starting, to gage how long a problem will take. Programms need to function as a whole, and the more complex the problem, the more you need to think about how each piece fits together. If you're rushing, it's far more likely that you'll break something than build something functional. Starting at least a few days before the deadline will give you room to deal with any unexpected problems.
- Think before you code: A program is just a faster and more reliable version of a procedure that can be done with a pencil and paper. If you do not have a clear idea of how you would solve the problem with a pencil and paper, then you are not ready to write code for it. Writing pseudocode, drawing pictures, and working through examples are all things you should do before any coding.
- Don't over-complicate it: All the assignments can and should be done using tools and concepts that have been covered in class or using resources we give you. If you are using a concept on the first homework that's on the calendar half way through the course, you are probably approaching it wrong. Not only is it possible to do all the problems using what we have taught, it is required. If your solution uses concepts or tools outside the scope of the assignment, you will not get credit for that work. Talk to a TA if you are unsure how to solve a problem without using other tools or concepts
- Compile and Test Early and Often: Finding a bug in 5 lines of code is far easier than finding a bug in 500 lines of code (a billion times easier, in fact). A good program is written in small, testable increments. You should not write the next section of your program unless you have a clear plan for how to test it.
- Before submitting, you should always reread the spec and recompile every program. Some of the biggest issues we run into when grading are students who miss one small aspect of the instructions, or who made a last minute change and miss a compilation error. Code that does not comply with our instructions or that does not compile is likely to get very little functional correctness credit. We also recommend you do a once-over for style issues, ensuring all headers and function contracts are written.
Getting Started
The first step for any assignment is to log in to the Linux server from the outside world, make a directory and copy or create some files. Detailed instructions on this process can be found in the lab0 spec.
If you are creating new files, you can do so using
touch filename
in your terminal, or through Atom.
If you create a file on Atom, you must upload manually to the department
servers by right-clicking on the file then going to
Remote-Sync-PRO > Upload.
This puts the files you made on Atom onto terminal/the department servers.
If you make or copy files in your CS11 directory in terminal/through the
department servers, you will need to go to your CS11 directory in Atom,
right-click on it, then hit Remote-Sync-PRO > Download, to bring it to Atom.
The gist is upload on Atom sends your file or directory from to
terminal/the department servers so you can run it, submit it, etc.
Download on Atom brings something from terminal/the department servers to
Atom so you can edit it in the text editor.
Note that Atom will not show an empty directory, so if you make a directory
in terminal/the department servers, you either have to put a file into it
before downloading to Atom, or you can make a directory in
Atom that has the same name as that you made in terminal/the department
servers, and the two will be linked.
Written Questions
Your homework assignments will include programming components and written
components. The written components will vary depending on the assignment,
but your written.text
should always clearly number and answer
each question, and have a header that includes the assignment, date, and
your name.
Don't get fancy with the characters, or try to copy and paste from Word
or other programs. They will often paste strange "invisible" characters that
can create issues when you submit your file.
As with all other files, your written.text
should follow the
80-column rule.
You will have to do this manually by typing an explicit return at
the end of each line (resizing the window does not change the length of a
line in the file). Also, do not let let your editor insert tab
characters in your file: each indentation should be 4 or more
space characters. This ensures your text and code will look the
same to the grader as it does to you, regardless of their tab settings.
Pseudocode
A common written question involves writing pseudocode for one or more of the programming assignments. Pseudocode is a written description of your algorithm that should not involve any programming syntax. It should clearly explain how your program should run and what steps it will take to solve the problem, but should not be the code itself. Think about how you might explain how your code works to someone with no programming experience. You should always write your pseudocode before coding, because it will help you write the code itself. Your pseudocode does not need to match your final program, so don't worry about editing it if you realize the original plan does not work.
Pseudocode should be in bullet points, and list the variables you plan to use along with their types and what they represent. You should also discuss any decisions your program might make, what condition it depends on, and how your program will respond in each circumstance.
Example 1: computing the number of minutes in a given number of years
-
variables:
-
num_years
: integer holding the starting number of years mins_per_year
: integer that will be set to the number of minutes in a yearnum_min
: integer holding the final result; how many minutes are in the input number of years
-
-
prompt user for
num_years
-
calculate
mins_per_year
to be60 * 24 * 365
-
calculate
num_min
to bemins_per_year * num_years
- print
num_min
as the answer
Example 2: Decide if someone can ride a rollercoster based on height and if they are with a parent
-
variables:
-
height_required
: integer that represents the height someone must be to ride the rollercoaster alone. height
: integer height of person trying to ride-
has_parent
: boolean that represents whether the person is with their parent.
-
- set
height_required
to be 40 inches - get
height
from person trying to ride - if
height
is greater or equal toheight_required
, then print that they can ride - otherwise, ask if the person has a parent with them and store result in
has_parent
- if
has_parent
istrue
, print that they can ride - otherwise, print that they are not tall enough to ride
You can read more about pseudocode on these lecture slides.
Testing and Debugging
Write a little, compile a little, run a little, and repeat! It's better to submit a small program that works than an ambitious one that has syntax or other errors. The best programmers never get too far into their coding before they test their program and make sure everything is working. Write a little bit of code, run it, and go back to writing. I compile at least every time I take a few minutes to think or every 5–10 lines of code I write, and usually I test the code at that point, too.
Indeed, there often are very useful tests you can do on a program that's only partly written. Maybe you think you can handle simple inputs (positive numbers, perhaps), but not more complex cases? Test what you've got! Try some positive numbers. Get that much working. We even have a name for this practice in computing: incremental development. If you write the whole thing and then test, well the problem could be anywhere. It will be hard to find! If you test incrementally, then there's a good chance that your bugs will be easier to find!
We may give some testing infrastructure, sample inputs and outputs, and/or a reference implementation for assignments to help you test. However, designing and writing a working program is your responsibility, and passing the tests we give does not guarentee full credit.
How to Test
A common question we get asked is how to start testing. Spend some time trying to break your code and thinking of weird interactions that could possibly happen. Try to do this at every step, testing each function or piece of the puzzle as you write it. This process will depend greatly on the specific problem, but there are a few examples below.
- If you have a program that uses numbers as inputs, you probably want to start by trying a small number. If that works, try out a really big one. You might then implement functionality for negative numbers and test with them (big and small). When you feel confident with those general cases, you probably want to try zero and one, which often cause problems. At this point, you might feel confident about your program, or might think of other weird inputs or interactions to try.
- If you have a program that uses lists or collections as inputs, it is always a good idea to test on an empty collection, a collection with one thing in it, a collection with a few things, and a pretty big collection.
Before submitting, you should always rerun all the tests you wrote to make sure you didn't accidently break something when fixing another bug.
11test
So you have a general idea on testing, but how do you know you've got it right? Or, in CS 11 terms, how do you know you'll get full credit? You don't really. There's always a chance you've missed something, but remember: to get full credit you must exactly and completely meet all of the specifications in the written instructions.
If the instructions say that a prompt should be Enter a number:
then you don't want to say Give me a number:
or even
Enter number:
. Include the colon (:
) if we ask
for one. Start new lines (using endl
) where the instructions
say to, and not when they don't. Get all of that right as well as the
functionality, and you will receive full credit.
That sounds like a lot to keep track of! To take some of the pressure off,
we have a tool called 11test
for some of the early assignments
that you can use after you've written and compiled your program.
Instructions using 11test
on a given assignment will be included
in the spec.
11test
will run your program one or more times,
possibly on different inputs, and report any problems that it
finds. Read the output carefully; it will tell you
what inputs were used and how your program responded.
(You must have run use comp11
before trying this;
if not the 11test
program will likely not be found.)
Q. If my program passes
all 11test
tests, will I get full credit for my
submission?
A. Not necessarily. Making sure that you have
correctly followed all the instructions is your responsibility,
but 11test
will help you find some common problems. For
HW1, if 11test
reports no problems then you can be
reasonable confident that at least the format of your prompts
and of your output is good enough for full credit. For later assignments
we will leave more of the format and other testing to you.
Q. If my program fails one or
more 11test
tests, will I lose credit on my submission?
A. Almost surely. Indeed, as described above,
mistakes in things like formatting can cause you to lose credit on
every test we run. You should try hard to fix any errors
that 11test
finds. If you need help or don't understand
why you are failing, come to office hours. TAs are more than happy to help.
Q. I'm really worried: I've spent a lot of time trying to fix bugs and I just can't get things to work. What should I do?
A. Well, we hope you're getting help from TAs etc. along the way, but programming can be difficult. Even very good students don't always get every program to work well. Do not let this discourage you! Typically you can get zero or low credit on a few parts of a few homwork submissions and still get an A or even an A+ in CS 11. You definitely should submit whatever you have, as (a) you may get significant credit for the parts of the program that do compile and run and (b) we also read your code to see what you tried: so you can get some credit for writing a promising submission that you never could quite get to work at all.
Style Guide
Along with how well your program functions, we also evaluate how your
code is organized and whether or not it is written with good style.
Remember: Programs are written for people to read. You are
communicating your algorithm to a human reader, the grader in this
case. Make sure your programs are beautiful, clear, and
well-documented, in addition to being correct! Lines should be under
80 columns. There should be spaces around all operators
(including =
). Like the other lines your programs write,
the last line should end with a newline (which in C++ you get using
endl
as you do on your other output lines), unless a particular
assignment asks you to do differently. And don't forget comments at the top
of each file describing that file and giving your name and the date. Think
about your code the way you would an essay; you write essays with a heading,
consistent margins and spacing, and correct punctuation. An essay with good
content but horrible style would not receive full credit, so neither will
code that works but disregards the style guidelines.
You are responsible for reading and understanding all the guidelines in the CS11 Style Guide.
Each week we give out a few "pleasure to read" points to students who have written code that is well commented, and just all around beautiful! To get the points, your code must follow all of the rules in the CS 11 style guide (linked above), must bring the grader aesthetic pleasure and have a strong sense of intellectual clarity. Only a few students a week are likely to get it. Work that is awarded the "pleasure to read" points is usually worthy of an A+ grade. Keep an eye out for this on your Gradescope report!
Projects
A project is basically a two week homework assignment on a bigger problem. Projects are split into parts to make them more digestable, but over the two weeks, you will build a big and interesting program. Past CS11 projects have included a database that tracked gene mutations, card and video games, and a simulated fish tank. We hope that you can come out of a project excited about an interesting program you've made.
A project is broken up into phases, with each having its own submission and being graded separately. Most of the overall grade is from the final submission. Specific weighting can be found in the project spec. There is more information on how project grading and submission in the sections below.
Grading
40% of your CS11 grade will come come from homework assignments which consist of weekly assignments and one or more projects. All homeworks are normalized to 100 points, and weigh equally besides projects which count as two normal homeworks. The lowest homework score may have its weight reduced, e. g., it may count only half as much as other assignments.
Programs will be evaluated for functional correctness (FC) and for style and organization. The weight of an assignment can be anywhere from 60–80% FC, with the remaining grade coming from style.
Functional correctness will be determined by an automated system that will run your program on various test inputs. Your program must compile on the department servers to receive any functional credit! The best way to ensure credit is through thorough testing, which is described in detail above.
Style and organization is graded manually by the staff, and will depend on having good coding practice, logical organization, and generally adhering to the course style guide.
Regrades
It is important that you understand any evaluation of your work. Therefore, you are always welcome to ask for an explanation of a grade you received.
Sometimes, we make mistakes, of course, and we want to get things right. If the mistake is in your favor, you don't have to do anything: it's your lucky day. If you feel there was an error that you have been deducted for, first think very carefully. If it is our mistake, then make a regrade request.
All regrade requests (whether for exams or homework) must be submitted via Gradescope within one week of the assignment grades being released. In cases where it is not immediately obvious how to submit a regrade request for a particular component of an assignment, it is always fine to submit the request on the first problem of the assignment.
A regrade request may or may not result in a new grade being assigned. The new grade may be higher or lower than the original grade.
Late Assignments
Homework is expected to be submitted on time. However, we recognize that the exigencies of college life occasionally thwart a deadline. In such circumstances, there are two types of extension:
-
Late tokens are for short-term issues like
a routine cold, sore throat, etc. A late token grants you a
24-hour extension on an assignment. Each of you has 5 of them to
use over the course of the semester. A maximum of two tokens
can be used on any single assignment; submissions more than
2 days late will not be accepted and will recieve a 0.
Using a late token requires no action on your part. Our grading scripts will automatically check the date of your submission and deduct the appropriate number of tokens. - Dean-supported extensions are only for cases of serious illness, family emergencies, or other unforeseeable severe difficulties. In these special circumstances, extensions are granted after we receive a request from your associate dean. No extensions are granted merely on the basis of a student request. Please do not ask the deans to support you if you are out of tokens or don't want to use tokens or if you simply mismanaged your time. Of course, if you do have a serious illness or family emergency, then definitely contact the dean so they can coordinate with all your instructors.
Token Summary:
- Each student receives a bank of 5 (virtual) tokens. Each token grants you a 1-day (24 hours) extension, no questions asked.
- You don't have to do anything to use a token. We'll check when your work comes in and deduct the appropriate tokens from your bank. However:
- If you intend to use a late token: Do not submit your work until you are ready to submit your final code. This will prevent us from grading an early version of your homework.
- If you do NOT intend to use a late token: Do not submit anything after the due date. We will grade your most recently submitted work as of the time a grader is assigned to your assignment. If that work came in after the due date, it will be counted as late.
- No more than two tokens may be used for a single assignment: Homework more than two days late is not accepted and earns a 0.
- Each phase of a project is considered a separate assignment in terms of token use, so getting an extension on the irst phase does not give an extension on subsequent phases.
- When you are out of tokens, we will no longer accept any late work from you.
- Ordinary illness (e.g., a cold, headache, migraine) is included in your token budget: That's what tokens are for!
Collaboration and Academic Integrity
Everyone should read the Tufts policy on academic misconduct
located on the student affairs office website:
https://students.tufts.edu/student-affairs/student-code-conduct/iv-policies-regarding-student-behavior
.
As stated in the tips above, it is important to note that all assignments can and should be done ONLY using tools and concepts that have been covered so far in the class. If you are unsure how to approach a problem, you should not begin by searching for an algorithm or solution online. Rather, come to office hours. If you have any doubt about whether a concept or tool can be used for a given assignment, ask the staff on Piazza. You will not get credit for work that includes tools or concepts outside the scope of the assignment.
Homeworks will be comprised of two components, a written component and a programming component. For each of them, we have slightly different policies about which forms of outside help and collaboration are acceptable:
Written questions
The goal of our written problems is to give students practice at finding pieces of information that they have not expressly been given in class and lab. This skill allows you to eventually function independently as a programmer, and is critical for all computer scientists to master.
As such, students are expected to find the answers to written problems themselves. They may not confer with their classmates, and may only minimally query the TA staff. From there, however, any means of finding an answer that does not explicitly contradict the written instructions is fair game. Students may search the internet, consult their textbook, write test programs — anything, as long as sources are cited in the write-up.
Programming
Both your classmates and the internet at large can be invaluable resources, so long as they are used according to the following policies:
- You may search the internet and talk to other students
about general programming concepts and C++ syntax,
but not about assignment-specific code or
strategies. For example, it is fine to ask “How do you
structure a
while
loop in C++?”, but it is not fine to ask “How do you write the function for HW 3 in C++?” Assignment-specific questions should only be posed to the course staff. - Use English. Use pictures on white boards. However, you should never be looking at another student's code and no one outside of our course staff should be looking at your code. If a TA sees you doing this, it will be reported.
- Only submit code you can explain. We reserve the right at any time to ask you to explain a piece of code that you submitted. If you cannot explain the code, then we will have no choice but to assume that it is not your work.
- Do not plagiarize code! You must not submit code that others wrote or that you wrote for a previous class (or previous iteration of CS 11).
Suspected academic integrity violations are forwarded directly to the Office of Student Affairs. Their sanctions range from horrible to inconceivably horrible. It's not worth it.