Welcome to the C++ exercises repository! This guide will help you get started with GitHub Classroom and understand how to use this repository for your assignments.
-
Accept the Assignment: Click on the GitHub Classroom link provided by your instructor. This will create a personal copy of the repository for you.
-
Clone the Repository: Once your personal repository is created, clone it to your local machine using:
git clone [YOUR_REPOSITORY_LINK]
-
Navigate to the Project: Change your directory to the cloned repository:
cd c_plus_exercises
-
Open the Exercise File: For example, open the
hello.cpp
file to work on the exercise. -
Implement the Function: Follow the comments and instructions in the file to complete the exercise. For the
hello.cpp
exercise, you'll need to implement theHelloWorld
function to return the string "Hello, World!". (for now, you shouldn't worry about for the first getting started exercise, just run the test and see if it passes, if it does, you're good to go!, you can commit and push your changes to your repository) -
Compile and Test: Use the provided
Makefile
or your preferred C++ compiler to compile and test your solution. -
Commit Your Changes: Once you're satisfied with your solution, commit your changes:
git add . git commit -m "Completed the Get Started exercise"
-
Push to GitHub: Push your changes to your personal repository on GitHub:
git push origin main
-
Verify Your Changes on GitHub: Visit your personal repository on GitHub and ensure that your changes are visible.
-
Submit Through Classroom: If your instructor requires, go back to GitHub Classroom and submit your assignment.
-
Wait for Feedback: Your instructor will review your code and provide feedback directly on GitHub.
If you encounter any issues or have questions, please reach out to your instructor or TA. You can also refer to the GitHub Classroom documentation for more information.
Remember to replace [YOUR_REPOSITORY_LINK]
with the actual link to the student's personal repository. This README provides a basic workflow for students using GitHub Classroom. Adjustments might be needed based on specific classroom settings or additional tools used in the course.
Description: Write a simple program that outputs "Hello, World!" to the console. This assignment will introduce you to the basic structure of a C++ program.
Test Code:
TEST_CASE( "Hello, World!", "[lesson:1]" ) {
REQUIRE( HelloWorld() == "Hello, World!" );
}
Students can use these descriptions to better understand the requirements of each assignment and write their code accordingly.
make test
make clean
g++
can be used to compile and link C++ applications for use with existing test harnesses or other C++ testing frameworks.- If students push
a.out
files, the autograder may attempt to run that version instead of a newly compiled binary. If this happens, and your are not on Linux, the script will crash. To fix this issue, it's recommended to clean before building.