You are on page 1of 1

School

of Information Technology

IT-160 Programming Logic Using C++



Prof. Alexis

Week 3 Lecture Notes



So far, we have been coding on paper. Desk---checking. And making sure our
algorithm is sound before jumping on a computer code solution. This is a sound,
logical and safe sequence of steps when solving a problem. By forcing us to think
ahead, we save ourselves unnecessary headaches down the line.

We will start transitioning to computer code beginning this chapter. In order to do
this, you/the programmer has to understand the rules and syntax of our/any
programming language. We start learning about the syntax of C++ with the
introduction of variables, constants and storage in computer memory.

We have learned about the computer memory in various computer subjects weve
undergone. The best analogy I usually tell my students is a computers memory is
like your filing cabinet; each cabinet/drawer represents a location where
something is stored. A cabinet/drawer cannot fit anything bigger than its size or
anything not meant to be stored in that location (we cant store liquid, as an example,
as itll just seep right through). We also need to remember where we stored a
particular item to retrieve it later on.

You can think of a particular cabinet/drawers location as analogous to computer
memory. Where we refer to a drawer in 2 slots to the right and 5 slots from the top, a
computer memory location represents where in memory it can be
stored/retrieved (address). You can think of what type of item that we can store in a
drawer as a computers data type. Whenever we store something in memory, we have
to define its name/location and data type before we can use it (and retrieve later on).

Check out the textbook to learn more about naming convention of variables and what
type of data the system/programming language can hold. Remember that these rules
are strictly implemented as theyre the languages syntax. Any deviance from this
syntax will result in an error.

You might also like