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 ↗- Open OnlineGDB, select C++, and type or paste the complete starter code into the editor.
- 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.
- Before clicking Run, predict the three lines of output. Then run the program and compare the result with your prediction.
- If you see an error, read the first message. Check quotation marks, semicolons, and braces, then run the program again.
- 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…
- Your own name appears.
- Each line is readable.
- The program compiles.
- The output matches your plan.
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.