Home
Contact Information
Announcements
Course Overview
Prerequisites
Grading
Schedule
Lab Times
Office Hours
Calendar
Lecture notes
Lab materials
Homework
Test reviews
Textbooks
Web Resources
Drop in Tutoring
Academic Integrity
Homework
Due Date and Time
Late Day Policy
Compilers
Electronic Submission
Programming Tips
C++ Development
Cygwin
Emacs
Dev C++
MinGW
Other Information
|
Programming Tips
Here are some general comments about program grading to help you earn
full credit on your homework. Points for programming assignments are
generally divided into:
- Error-free compilation,
- Program structure, and
- Correct program output.
The program structure grade is an evaluation of the quality of your
code. This includes the following:
- Your code should have a clear, logical organization. Functions
should be written as appropriate to break up the program. Don't put
all of your code in the main function. In general, each function
should easily fit on a single screen.
- Variable names should be intuitive and meaningful. For example, if
you need a variable to represent an employee's salary, use the name
salary, not x.
- Use comments to describe functions and significant sections of
code. These don't have to be long and involved. Keep them short and
clear.
- Use a consistent, logical method of indentation to make your
program easy to read. For example, code inside a loop or if-else
condition must be indented all at the same level (until reaching the
inside of a nested loop or nested if-else construct).
- Don't type lines of text that are too wide to fit the
screen. Break statements cleanly across multiple lines as needed.
- Avoid the use of global variables. Global constants are generally
fine.
Use the example code given in class, in lab, and in the
textbooks as guidelines. Programs that are unclear and do not compile
will earn little or no credit.
Program correctness will be determined by evaluating your program on a
series of test data sets. We will make available some but not all of
this data, along with sample output, prior to the assignment due
date. This will help you judge the quality of your program, but will
not guarantee correct results on all data. You will need to ensure
this on your own by creating additional test cases.
|