Programming Assignment Overview

All programming assignments must be implemented with C or C++ using the CMake cross platform make tools. CMake is a set of tools that provides an easy way to utilize different platforms and development environments (e.g. Mac OSX with XCode, Linux using Makefiles, Windows using Visual Studio, etc.). Using CMake, you are encouraged to utilize whatever development tools and platform you are most comfortable with.

While many tutorials on CMake are available online, a simple overview CMake is provided within several of the projects discussed in Lecture. This tutorial and accompanying example can be used to test the following sequence of commands that will be utilized to compile and grade all assignments.

Programming Assignment Schedule

Assignment 1 – (50 Points) REVISED Due W September 14, 11:59PM
Assignment 2 – (100 Points) - Due W October 05, 11:59PM
Assignment 3 – (100 Points) - Due F November 04, 11:59PM
Assignment 4 – (100 Points) - Due W November 16, 11:59PM
Assignment 5 - (150 Points) - Due Wednesday, December 07, 11:59PM

Extra Credit Programming Assignments

Extra Credit Assignment 1 – (25 Points) Due M October 24, 11:59PM
Extra Credit Assignment 2 – (Maximum 25 Points) Due W December 07, 11:59PM

Submission Requirements

  • All programs must be submitted to the corresponding DropBox on D2L.
  • All programs will be compiled and graded using ece3.ece.arizona.edu.
    All assignments will be compiled and tested using the ECE department server ece3, on which the CMake tools are already available. You can access the ece3 server using any secure shell (SSH) client. You are strongly encouraged to test your programs using the ece3 server before submission.
    Note: If you use your own computer for development, you will have to download and install the CMake tools.
  • All submitted assignments will be compiled using the following commands:
    cd NetID_assignment_directory
    mkdir build
    cd build
    cmake ..
    make
    ./src/assignment_name
    Note: assignment_directory and assignment_name are placeholders for the actual assignment name, and NetID is you UA NetID.
  • All assignments must be submitted as a single TAR/GZIP (.tgz) or ZIP (.zip) using the naming convention NetID_assignment_name.tgz or NetID_assignment_name.zip, where NetID is you NetID and assignment name is the name of the assignment. The submitted archive should use the following directory and file structure:
    NetID_assignment_directory
       |
       ---> CMakeLists.txt
       |
       ---> README
       |
       ---> src
    Note: You can create a TAR/GZIP archive for your assignment using the following commands on the ece3 server.
    /usr/local/bin/tar cvzf NetID_assignment_name.tgz NetID_assignment_directory
    Note: assignment_directory and assignment_name are placeholders for the actual assignment name, and NetID is you UA NetID.
  • Do NOT include build files, executables, temporary files, etc. with your assignment submission.
  • All assignment submissions must include a README file that minimally contains your name, UA NetID, date, assignment number, and a brief description of the your submitted assignment.
  • Programs that fail to compile will receive a score of 0. NO EXCEPTIONS.
  • All assignment submissions should compile without warnings. Submissions that result in compiler warnings using the gcc compiler on the ece3 server with the -Wall option will incur a reduction of 5% for the assignment grade. NO EXCEPTIONS.''
  • Programs that incorrectly terminate due to invalid memory accesses (e.g. segmentation faults, bus errors) will incur a reduction of 25% for the assignment grade. NO EXCEPTIONS.

C Coding Style and Standards Requirements

All programming assignments must adhere to good C coding and style guidelines. Good coding style and standards helps improve your code's readability, reusability, and maintainability. For each assignments, 10% of you assignment grade will be based upon the following criteria:

  • Commenting (4%): Comments should be effectively and thoroughly utilized to annotate your software code such that other programmers can understand the functionality of your code, easily reuse or modify your code, and even debug your code. Comments should minimally be used for the following:
    • Source Files: A block comment should appear at the bringing of all C source and header files and include your name, date, and description of the contents of that file.
      Note: If you submit any files that do not include your name, you will receive 0 points for Commenting for the entire assignment.
    • Function Declarations and Definitions: Both function declaration and definitions should due included a preceding comment to describe the functions
    • Constant, Type, Variable, and Other Declarations: All user defined declaration of variables, types, constants, #define's, struct's, etc. should include a comment to describe how that element will be utilized.
    • Code Functionality: Comments should due included to describe the major computational steps within flow of your code's functionality such that other programmers can understand the decisions you made in organizing your code. While some coding operations may seem obvious, comments help to explicitly define the intent of the programmer.
  • Code Organization and Reusability (4%): Your software code should be organized effectively into files, data strictures, algorithms, and functions to allow for efficient reuse both by yourself and by other programmers. The provides an overview of the primary code organization and reusability metrics your assignments will be graded on:
    • Source and Header Files: Source and headers files should be utilized to organize code with related functionality.
    • Functions (Modularity and Reusability): Function should be utilized to define individual operations used within your program, such that each function has a well-defined operation. Functions soul due used to construct your software in a modular and reusable manner. Your code should be as reusable as possible to the extent that if a portion of your code could be reused within another operation, or even another program, that operation should be defined in a separate function.
      Note: If you submit your assignment as a single file, you will receive 0 points for Code Organization and Reusability.
  • Coding Style and Standards (3%): A consistent coding style should be utilized throughout software code to ensure your code can be readily understood. Although some flexibility is afforded in coding styles, you should utilize a consistent coding style though out your programming assignments. Consult Recommended C Style and Coding Standards for an informative and in-depth discussion of C coding styles and standards. The following provides a brief overview of the primary coding style guidelines you should utilize for all programming assignments:
    • All code blocks should be consistently indented either using spaces or tabs. Do not mix spaces and tabs for indentation your C files. Note: You can configure most source code editors to indent code using either spaces or tabs automatically.
    • Use consistent style for opening and closing curly braces. For example, the following are both acceptable bracing styles:
      if ( temperature > 95 ) {
          printf("Go to better location!\n");
      }
      else {
          printf("Enjoy.\n");
      }
      while ( list_node_ptr != NULL )
      {
          printf("%Name = %s\n", list_node_ptr->label);
          list_node_ptr = list_node_ptr->next_node;
      }
    • Variable and function names should start with a lowercase character and either use underscores or uppercase characters to separate words within the names. Choose one of these styles and use consistently. For example, the following are both acceptable variable names:
      unsigned int num_nodes_searched;
      double averageYearlySalary;
    • It is typical to include the following to enclose the contents of C header files. This ensures that errors will not result from including a header files more than once during compilation. Note HEADERFILENAME_H should be replaced with the name of each C header file.
      #ifndef HEADERFILENAME_H
      #define HEADERFILENAME_H

      /* header file contents */

      #endif
    • Use ALLCAPS for any #define's.
    • Avoid using #define's to define constant values. Instead, define a static constant with an appropriate name. Use either ALLCAPS or InitialCaps to define static constants. Choose one of these styles and use consistently. For example, the following are acceptable constant declarations.
      static const int ImageRowSize = 400;
      static const int IMAGE_ROW_SIZE = 400;
    • Use ALLCAPS for enum constants. For example:
      enum { STATE_IDLE = 0, STATE_READY = 1; STATE_RUNNING = 3 };
    • Structure declaration should be accompanied by a type declaration to define a custom type for the structure. Structure declarations should use InitialCaps for the structure name, in which the structure name and each word within the structure name begin with an uppercase character. Optionally, underscores can be utilized to the separate the words within the structure name. For example:
      typedef struct GraphNode_t {

          int node_id;
          char *node_label;
          int dist_from_source;

      } GraphNode;
    • You should explicitly check the return value from all non-void functions to check for errors. If an error occurred, be sure to report the error and abort the program in an appropriate manner.