C++ Programming

WEEK 1 · ASSIGNMENT

Your First OnlineGDB Program

Write a short C++ program about yourself. Run it, change it, and test it.

Your Task

Open OnlineGDB ↗
  1. Open OnlineGDB, select C++, and type or paste the complete starter code into the editor.
  2. Replace the three blanks with your name, your field of study, and one thing you want to learn. Keep the quotation marks and \n at the end of each message.
  3. Before clicking Run, predict the three lines of output. Then run the program and compare the result with your prediction.
  4. If you see an error, read the first message. Check quotation marks, semicolons, and braces, then run the program again.
  5. Once the program works, change your learning goal. Predict the new output, then run it again to check your change.

Starter Code

Download .cpp
#include <iostream>

int main() {
    std::cout << "Hello, my name is _____.\n";
    std::cout << "I study _____.\n";
    std::cout << "I want to learn _____.\n";
    return 0;
}

Example Output

This is an example. Use your own information in your program.

Hello, my name is Alex.
I study Computer Science.
I want to learn C++.

Done When…

Show and Explain

Show your program and its output to a partner. Explain one output statement, what you changed, and how you checked that the change worked.