This is a repository for programing exercises in C++ and Python to give students practice in developing code.
-
There are multiple exercises for both C++ and Python that can be completed one by one. Each exercise gets harder and bulids on the last.
-
Code can be tested by pushing to GitHub and reading the output of the GitHub actions. Code can also be tested locally by following the commands in each exercise.
-
If you plan on testing using GitHub, we highly recommend the GitHub Actions extension for VSCode because it allows you to easily see your scores for each test in VSCode. To see specific error messages look at GitHub.
- First you will need to fork the repository on GitHub (just click Fork in the upper right and follow the steps)
- Once you have your own repository, you need to clone it to your local machine. Use "git clone [your SSH clone link]"
- Now you are ready to setup C++ and Python
There are exercises for both C++ and Python.
- To locally compile and run the C++ code you will need the g++ compiler
- To install g++ use "sudo apt-get install g++"
- C++ code should be written in .cpp files
- Each exercise has specific instructions to compile and run
- Tests are written using Pytest
- To install Pytest use “python3 -m pip install pytest”
- Python code should be written in .py files
- Each exercise has specific instructions to compile and run
- To run every test for every exercise run "python3 -m pytest"
- Complete an exercise
- Once ready to check an exercise either
- Push to GitHub
- Locally check Python
- Run “python3 -m pip install pytest” to install pytest
- Run “python3 -m pytest” to test the python exercises
- Locally check C++
- Run “make” to compile all exercises (g++ compiler)
- Run exe file with input redirection
- Example: ./ex01a.exe < ex01.input.txt