Strings and the
Standard string Class
In the lab session we began to work with text: data items
composed of multiple characters.
This lecture introduces two ways of representing and
working with such d
Say you want to write a payroll system. Your company has
many employees and to pay them correctly you need to keep
track of their monthly salary.
Also there are two leve
Programming and C+
A set of instructions for a computer to follow. We
usually say we run a program on the computer, and that the
computer executes the program.
Flow of Control
Part 1: Decisions
More than 50 years ago, it was proved that every program, regardless of
complexity, could be rewritten using only subunits of three different
Basics of File I/O (Input/Output)
Communicating with our
So far, all data input to our programs has come from the
keyboard, and all output has been to the display using the
standard input and output s
We can declare arrays with two (or more) indexes. These are known
as multi-dimensional arrays.
2D arrays are great for implementing table-like data objects, such as
/ A table w
Breaking a task into
So far, we've written our programs as a group of statements in
But if we structure large programs like that, the code would be very
difficult to understand
Data Types, Variables, Basic
I/O and Expressions
Data Types and Variables
Recall from earlier
Main memory provides
temporary storage for data
and for the program being
A typical program processes input data to produce output data.
So far, our programs have worked with only small amounts of data.
As we increase the amount of data, we find th