Skip to content

m-eg/GCH-CPlusPlus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GCH C++ (VS Code & GitHub Codespaces)

This is a repository for a GitHub Copilot for Business Hackathon with C++

⚒️What are we building

We are building a interest calculator together with a unittest.

Prerequisites

This introduction is written for VSCode/GitHub Codespaces. Please install the following extentions.

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.

📖 Additional useful Resources

  • Video on different ways to use GitHub Copilot in VS Code.
  • Video on top 10 features.

⌨️ Nice to know: GitHub Copilot Shortcuts

Shortcut Description
Ctrl+i Open inline chat
Ctrl+Alt+i Move to chat
Ctrl+Enter Accept code suggestion from chat

Scenario 0️⃣: Start with Copilot

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

Scenario 1️⃣: Create interest calculator without compound interest

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.

Scenario 2️⃣: Create interest calculator with compound interest

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.

Scenario 3️⃣: Build simple unittest

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

⚠️SPOILER ALERT: Here are some sample prompts if you get stuck!

You can find solutions in the Solutions folder.

How to run test file with gtest

g++ -o ZinsesZinsRechnungTest ZinsesZinsRechnungTest.cpp -lgtest -lgtest_main -pthread
./ZinsesZinsRechnungTest

Sample prompts

Scenario 0

Say Hello

Hello Copilot. Please answer in english.

Try these commands

/help
/fix
@Workspace
#file
/explain

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%