

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Class: DATA STRUCTURES; Subject: Computer Science - CSCI; University: Texas A & M University-Commerce; Term: Unknown 2005;
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


To receive full credit, each programming assignment must be handed in on the due date no later than the closing time of the CSCI labs. If you skip class on the day a program is due, it is automatically one day late even if handed in later that day.
Programs may be turned in after the due date for partial credit. You will lose up to 5% of the total points for each day the program is late (a day is a school day MTWRF, not including weekends or holidays). No program will be accepted for credit after the graded programs for that assignment have been handed back.
Each program you turn in must contain an initial block of comments with this information:
The program should contain sufficient additional comments to clarify what you're doing. A reader of the program should be able to determine from the comments alone a general idea of what is happening without actually having to decipher any code. Avoid redundant comments which don't add to the reader's comprehension. Good comments explain why you're doing something or what it means in the context of the program.
Here's an example of what I consider to be helpful comments in code searching for the largest value in an array. Also notice how the variable names are chosen to describe the values the names represent.
hiVal = arr[0]; // Assume first element's value is largest hiSub = 0; // Remember position of largest value n = 1; // Start searching with the second element while (n < MAX) // Look at each element { if (arr[n] > hiVal) // If this element value is larger than previous largest found, { hiVal = arr[n]; // save it as largest, hiSub = n; // and remember its position } n++; // Look at the next element } // end of loop to find the largest element
Modularize your programs. The main function should have minimal references to implementation-dependent details. Unless a particular assignment states otherwise, only file variables may be declared globally; all other variables used by a function must be declared locally or passed as parameters. Every program module should have a block of comments explaining what the module does.
Make your classes general and flexible for maximum reusability. Provide class access functions to return private variable values so that clients can code their own functions for operations the class implementer didn't anticipate.
Choose reasonably descriptive identifiers to name variables, constants, functions, classes, etc. Single- character identifiers are unacceptable except for variables like subscripts and loop-control variables (and a more descriptive identifier is recommended for these variables whenever it is appropriate).
Please use at least minimal indentation standards such as indenting statements within a loop, aligning the clauses of IF statements, etc. This will not only make me happier but will also make your life easier in reading and debugging your own programs. Following the coding styles used in the Nyhoff book programming examples would be one way of choosing a good coding style. In any case, whatever style you choose be consistent in applying it throughout your code.
Use blank lines liberally to separate sections of your program, and use extra spacing within a statement to enhance readability.
For each assignment, hand in a machine-readable copy of all source files needed to run your program. Since I will compile and run each program myself, it is not necessary to give me other files, like workspace or executable files. Your main program should have a filename of your name or initials and the program number (for example: SMITH1.CPP or JMS1.CPP or JIM-1.CPP )
You may:
No matter how you hand in your program, please make sure that your name appears in comments in every file, including output files created by your program and class files taken from the text.
Each program will be graded on a 10-point basis:
0-19 Little or no original work accomplished 20-39 Program doesn't compile, but you've made a reasonable attempt 40-59 Program compiles but produces little or no meaningful output 60-79 Program compiles and runs, but there are major errors 80-99 Program compiles and runs, but there are minor errors 100 Program runs correctly, satisfies all requirements, and has good programming style
Programs which are so similar that they are almost certainly copies of one another will receive a grade of zero. Unfortunately this penalizes the original author as well as those who cheat. To protect yourself from this penalty, protect your own work. Don't leave copies of your program on the hard disk of a lab PC and don't leave diskettes or hard copies of your program lying around. Definitely do not give anyone else a copy of your program.
You must have at least a passing (60%) average on programming assignments in order to pass the course, regardless of how high your exam grades may be.