Learn

You made it to the end of the lesson! High five. 🙌

Here is a review of the lesson:

  • A variable represents a particular piece of your computer’s memory that has been set aside for you to use to store, retrieve, and manipulate data.
  • C++ basic data types include:
    • int: integers
    • double: floating-point numbers
    • char: individual characters
    • string: sequence of characters
    • bool: true/false
  • Single equal sign = indicates assignment, not equality in the mathematical sense.
  • cin is how to receive input from the user.

Instructions

1.

Optional:

Use the open space in review.cpp to practice what you learned about variables. Here are some ideas:

  • Create a program that takes in the weight of an item and then calculates how much that item would weigh on Mars.
  • Create a program that asks for a distance in miles as input. The program will then output how much that distance is in kilometers.

(You can also just run the code as is to move on.)

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?