This is a repository for a GitHub Copilot for Business Hackathon with C++
We are building a interest calculator together with a unittest.
This introduction is written for VSCode/GitHub Codespaces. Please install the following extentions.
- C/C++
- GitHub Copilot
- GitHub Copilot Chat (will install automatically)
In addition, please execute the following commands in the terminal:
sudo apt-get update
sudo apt-get install libgtest-dev
To use GitHub Copilot, you must have an active subscription for GitHub Copilot in your personal account, or you need to be assigned a seat by your organization. Sign up for a GitHub Copilot free trial in your personal account.
Shortcut | Description |
---|---|
Ctrl +i |
Open inline chat |
Ctrl +Alt +i |
Move to chat |
Ctrl +Enter |
Accept code suggestion from chat |
Task: Get yourself familiar with Copilot inline code and Copilot chat. Try out Slash commands
//help
together with Strg
+ Alt
+ Enter
and ask Copilot some questions about code / coding.ch
Task: Use GitHub Copilot chat to create an interest calculator in C++ (.cpp file). Keep in mind that you want to import this module later in your unittest file. Hint: If you're unsure about the formula for interest without compound, ask Copilot for assistance.
Task: Use GitHub Copilot to create an interest calculator with compound interest. But this time, use the comment or online chat function to ask Copilot for assistance.
Task: Build a simple unittest for the interest calculator. Test different scenarios such as:
- Calculating interest for different principal amounts
- Calculating interest for different interest rates
- Checking that the calculated interest matches the expected result
You can find solutions in the Solutions
folder.
g++ -o ZinsesZinsRechnungTest ZinsesZinsRechnungTest.cpp -lgtest -lgtest_main -pthread
./ZinsesZinsRechnungTest
Say Hello
Hello Copilot. Please answer in english.
Try these commands
/help
/fix
@Workspace
#file
/explain