Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

General Policy for Programming Assignments - Fall 2005 | CSCI 152, Assignments of Computer Science

Material Type: Assignment; Class: Programming Fundamentals II; Subject: Computer Science - CSCI; University: Texas A & M University-Commerce; Term: Spring 2005;

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-iaf
koofers-user-iaf 🇺🇸

4.3

(2)

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download General Policy for Programming Assignments - Fall 2005 | CSCI 152 and more Assignments Computer Science in PDF only on Docsity! CSCI 152 General Policy for Programming Assignments Spring 2005 DUE DATES To receive full credit, each programming assignment must be handed in on the due date no later 11pm. 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 (and be aware I will try to grade and hand back assignments as quickly as possible). PROGRAMMING STYLE Each program you turn in must contain an initial block of comments with this information: 1) your name 2) the class 3) the assignment number 4) the compiler you are using 5) the main function file should name all of your source files needed to run the program 6) a detailed statement of the purpose of the program Assume the reader has not seen the program assignment and needs a general understanding of what your program does and how it works. Try to answer these questions in your statement: What values does the program input? What values does it output? What kind of processing does the program do to obtain the output values? Explain any processing which would not be obvious to a reader not familiar with the assignment. 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, { 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 program. 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. When creating a class try to make it general and flexible for maximum reusability. Always 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 happy but will also make your life easier in reading and debugging your own programs. Following the coding styles used in the Malik 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.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved