This is a CLI tool written in C++ where the user can enter specific stats related to Barry's workout (see Using the Program for more info). This project idea combines my desire to learn C++ and a way to catalog my Barry's workouts. It allows users to log their workouts in a separate .txt file. If needed, the user can also delete a workout related to a specific day.
Barry is not a man (in this scenario) - Barry's refers to a 60 min HIIT workout focused on running and floor exercises. In case this piqued your interest - https://www.barrys.com
-
Features
-
Using the Program
-
My Hot Takes
-
Future Improvements
The program stores the workout data in a text file called WorkoutData.txt.
Each workout is written as a block of lines, including the date, day, workout focus, instructor name, incline, sprint speed, and max weight lifted.
-
Date Entry: Prompts the user to enter the date of their workout in the
MM/DD/YYYY
format. It performs a check on the format and validates the date. -
Day and Focus Entry: Asks the user to input the day of the week and returns the workout's focus for that day. For instance, if the user enters "Monday," the focus is "Arms & Abs."
-
Instructor Entry: Requests the user to enter the name of their workout instructor. It ensures that the name is not empty and contains only alphabetic characters and spaces.
-
Incline Data: Asks the user to input whether there was an incline in their workout (Yes/No).
-
Sprint Speed Entry: Prompts users to input their fastest sprint speed. This should be an integer value.
-
Max Weight Entry: Asks the user to enter the maximum weight they lifted during their workout.
-
Delete Workout: If the user deletes a workout, it prompts them to enter the workout date they wish to delete and removes that workout's data from the log.
-
Open up your Terminal (On Mac – go to your finder and type
Terminal
) -
Please check your relevant O/S to find your specific terminal instructions
-
Make sure you have the g++ compiler installed on your Mac. You can check this by typing
g++ --version
in your terminal. -
Navigate to the directory containing the cpp file using the cd command. For example, if your code is in a folder on your desktop called "Project," you should type
cd Desktop/Project/
. -
To compile the code, you can use the
g++
command. If your source file is named barrys.cpp, typeg++ -std=c++11 barrys.cpp -o barrys
. This will compile barrys.cpp into an executable named barrys. -
Congrats! If there were no compilation errors, your code has been successfully compiled. Now, you can run the program by typing
./barrys
.
The delete function was a hassle and is still not clean as I like it to be – but it works.
In the same vein, I wanted the user to be able to edit the workout, but that was like quicksand.
My primary motivation was to understand C++ and make stuff work
- Ability for the user to be able to edit a workout in addition to be able to delete a workout seamlessly
- A better interface
- Comprehensive test suite