Objectives
-
Write an interactive program that allows you to create, store and edit notes about your workouts
-
Write the program in C
-
Give it the theme of an old command-line user-interface
-
The program must interact with the file system
-
Avoid using sophisticated libraries
Methods/Features/Results
-
The workout notes are stored in CSV files with the following naming convention:
(name of workout)(date in yyyy-mm-dd format).csv -
When the user is prompted to add or edit a workout, the existing and incoming workout information is loaded into a 'database' struct, effectively a dynamic array which stores each line of the CSV file.
-
An entry in the workout log contains several fields: the exercise performed, the number of sets done with the specified exercise, the number of repetitions per set, the weight lifted on each repetition, any comments about the exercise, and a timestamp which indicates when the entry was made to the workout log.
-
The program has 6 commands: 'add', 'remove', 'update', 'list', 'save' and 'exit'.
-
Quite robust in the face of user input.
-
Careful and appropriate use of dynamic memory allocation