CSCI 103 Fall 2017 Introduction to Programming

CSCI 103 Fall 2017: Introduction to Programming

Programming Assignment Warnings

This page tries to explain warnings and errors that you can get when uploading your code and checking it.

One reason these are important is that we print out your code for grading. If you fail to adhere to these rules, it won't print out the way you intended, and it can be hard to read or test your code.

file is indented with a mix of tabs and spaces

This means that your code might print with indentation other than what you intended.

Normally you shouldn't be getting this message unless you are not using the course VM or changed gedit's settings. Feel free to ask for help from the instructor figuring this out.

To fix the problem for a single file:

  1. Open gedit on the file causing the warning
  2. Press ctrl-H to open the Replace tool
  3. In "Search for:" type \t
  4. In "Replace with:" type 3 spaces
  5. Press Replace All and Close
  6. Save the file

Also you can change your editor to help solve this in the future, even having it insert spaces rather than actual tab characters even when you press the TAB key:

found a line longer than 80 characters

If your lines are more than 80 characters long, they'll "wrap around" when we print them and be hard to read. You should fix this, even if it's just comments.

Note that C++ ignores whitespace, and a "new line" is just whitespace. So you can change

int x = some + incredibly * long - line (with, many, things[on][it]); // long!

to

// we'll break the line in two
int x = some + incredibly * long
        - line (with, many, things[on][it]);

Moving comments above text instead of beside text can also help.

found non-ASCII characters

The most common non-ASCII characters are "smart quotes" or "smart hyphens" entered into your code by copying-and-pasting. You should delete these because we'll see garbage instead when your code is printed. And if they're in your code, it might not compile or run.

appears to be a 'rich text file' not a 'plain text file'

You might have edited this file with TextEdit on a Mac or WordPad on a PC. You can use the same program to open it and save it again in a plain text format.