Skip to content

Lab 1 Assignment

CT 301: C++ Fundamentals · Summer 2026
Reading Lab 1: Foundations and Constants
Source: learncpp.com · Instructor: Dr. Francisco R. Ortega

Overview

These reading labs give you time to slow down, read carefully, and try the ideas yourself. In this first lab you will read three short lessons on how C++ stores values, what the fundamental built-in types are, and how to define values that should never change.

A note on style: the lecture slides use import std;. In this class, and in these labs, we will use #include (for example, #include <iostream>). Both are valid modern C++, and the learncpp reading also uses #include.

Reading Assignment

Read the following lessons on learncpp.com. Each opens in a new tab.

1.3 — Introduction to objects and variables
What an object and a variable are, and how a value lives in memory.
4.1 — Introduction to fundamental data types
The built-in types (int, double, bool, char, and friends) and what they hold.
5.1 — Constant variables (named constants)
Using const to define values that must not change.

Optional, if you want more depth: continue through the rest of Chapter 4 for the specific numeric and character types, and read 5.6 on constexpr variables.

What You Submit

A short written reflection on what you read. Your reflection must:

  • A document with your name, 1 to 2 pages, Times New Roman 12 point, single-spaced.
  • Explain, in your own words, the main ideas you took from the reading and how they connect to what we covered in lecture. There is no need to use AI, as you are not being graded on this, just effort.
  • An appendix with screenshots is optional.
  • If you have trouble, let us know, and you will still get the grade.

Grading

 

Full credit
You did the reading and made a real attempt at the reflection.
Zero
No submission, or no real try.

 

How to Submit

Upload your reflection as a PDF.

Appendix: Online C++ Compilers

Any of the tools below will run the reading examples in your browser, with no local setup (unless you want to). Remember to use #include online, not import std;.

Our course toolchain is GCC 15.2 with -std=c++26. Only Compiler Explorer lets you set that exact combination. The other tools run an older fixed compiler, which is fine for these basic examples.

Compiler Explorer (godbolt.org) RECOMMENDED
The best match for our course. Lets you pick the exact compiler and see results and assembly.
How to use:
  1. In the compiler dropdown, choose x86-64 gcc 15.2.
  2. In the Compiler options box, type -std=c++26.
  3. To run the program (not just compile it), open the Execution or Add tool > Executor pane.
  4. Use the Share button to get a link to your code.
Python Tutor (pythontutor.com)
Best for seeing what your code does. It steps through line by line and shows variables and memory. Very useful in later labs on pointers.
How to use:
  1. Select C++ from the language menu.
  2. Type your code and press Visualize Execution.
  3. Step forward and back to watch values change.
Note: it runs an older fixed compiler, so you cannot set GCC 15.2 or -std=c++26 here. That is fine for the basic examples.
OnlineGDB (onlinegdb.com)
A simple editor with a real step-through debugger, good for watching a program run one line at a time.
How to use:
  1. Set the language (top right) to C++.
  2. Use the settings gear to pick the C++ standard.
  3. Press Run, or Debug to step through the code.
Note: older fixed GCC, may not offer c++26. Fine for the basic examples.
Wandbox (wandbox.org)
The quickest paste and run, with a shareable link.
How to use:
  1. Pick the newest GCC from the compiler list.
  2. Choose C++26 from the standard menu, or add -std=c++26 to the options.
  3. Press Run, then Share for a link.