Skip to content

Blubern/GCH-CPlusPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GCH C++ (VS Code & GitHub Codespaces)

This is a repository for a GitHub Copilot Demo for C++

⚒️What are we building

We are building an interest calculator together with unit tests.

Step 0️⃣: Prerequisites

  1. Clone or Fork this Repository.
  2. Open GitHub Codespaces or VS Code
    2.1 The demo can also be run in other IDEs. However, the hints are only given for GitHub Codespaces and Visual Studio Code.
  3. Please install the following extensions.
    3.1 C/C++
    3.2 GitHub Copilot
    3.3 GitHub Copilot Chat (will install automatically)
  4. Familiarize yourself with GitHub Copilot.

📖 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 1️⃣: Understanding an existing file

As a software engineer, you often need to understand code written by others. The first scenario shows you how to use the /explain and the /fix command of Copilot.

Scenario 2️⃣: Creating Code

In the second scenario, you will build a compound interest calculator. You will see how fast you can generate code.

Scenario 3️⃣: Building unit tests

At last, you will build unit tests for the compound interest calculator using Copilot. You may want to use the /tests command for this.

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

⚠️ Hints and Solutions

In case you feel stuck, you may want to reach out to the hints or solution folder. There, you can find helpful tips and bugfixes, which may help you.

🗨️ Remember: Context is key

Copilot cannot read your mind. Try to be precise in your wording. Also, you want to use the @-Command to provide better context and the /-Command to make the task clear.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages