Skip to content

Latest commit

 

History

History

chord-consolidated

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

CMSI 284 Computer System Organization/Systems Programming, Spring 2020

Chord Consolidated

Finally, the moment many of you have been waiting for—consolidating the functions written for “Oh Say Can You C” into a single file, to be shared with all of the programs that you wrote!

What to Do

There shouldn’t be any new code to write for this section; just some rearranging (and a lot of deleting!):

  1. Move your split_string_at_index implementation to string-plus.c (joining is_non_negative_numeral as an addition to our own collection of reusable string functions)
  2. Move all chord-related implementations to notes.c
  3. All of your programs should be left with just the main and any helper functions written specifically for those programs (i.e., not needed by the chord-related “public” functions)

The notes.h file has been revised in this assignment to accommodate this move, so keep that untouched. In addition, a string-plus.h file has been created to accompany the new string-plus.c file.

After these changes, your split-string-at-index.c program should now compile this way:

gcc string-plus.c split-string-at-index.c

All chord-related programs should now compile this way:

gcc string-plus.c notes.c <file-with-main-function.c>

The resulting a.out’s should then behave exactly like your current implementations.

Note that this assignment is solely about correct code consolidation. If your implementations have bugs, then those bugs will not result in deductions in this assignment. You are being graded on correct restructuring for this one; the previous assignment covers actual functionality.

Specific Point Allocations

This portion of the assignment is scored according to outcomes 3a, 4a, and 4b in the syllabus. For this particular assignment, graded categories are as follows:

Category Points Outcomes
Consolidated code compiles and runs as specified 6 3a, 4a
All shared/“public” functions are defined only once across all files 4 4b
Total 10

Note that inability to compile and run to begin with will negatively affect the correctness of program output and proper handling of invalid user input.