CISC-1600-E01 is course reference number 27620, 3 credits.
CISC-1610-E01 is course reference number 27621, 1 credit.
The home page for these two courses is
https://markmeretzky.com/fordham/1600/
A computer is a machine that follows instructions. The list of instructions you put into the computer is called a program. In the future, it will be possible to write programs in English. But that day hasn’t come yet, so for the time being we write programs in simpler languages such as C++. This is a course in reading, writing, executing, and debugging programs in C++. This language is an extension of the earlier language C. In other words, C++ is a superset of C, and C is a subset of C++.
CISC-1600 will cover the C subset of C++, except for pointers. The rest of C++, including the features for object-oriented programming, will be covered in CISC-2000.
CISC-1610 is the hands-on lab that goes with CISC-1600, and CISC-2010 is the hands-on lab that goes with CISC-2000.
Mark Meretzky
has no office or office hours.
But you can Zoom him, or email him at
mmeretzky@fordham.edu
.
Please contact him when you need help;
he wants to hear your story.
If the students desire,
the instructor can arrive on campus an hour before class
to offer individual help.
We’ll talk about this once the course begins.
CISC-1600-E01 and CISC-1610-E01 will meet on 14 of the following 15 Thursday nights. That means we can take one snow day or one vacation day (e.g., Hallowe’en). There is definitely no class on Thanksgiving (Thursday, November 28, 2024). The midterm will be on the seventh night of the course, Thursday, October 10, 2024. The final exam will be on Thursday, December 19, 2024.
2024 July August September Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 1 2 3 1 2 3 4 5 6 7 7 8 9 10 11 12 13 4 5 6 7 8 9 10 8 9 10 11 12 13 14 14 15 16 17 18 19 20 11 12 13 14 15 16 17 15 16 17 18 19 20 21 21 22 23 24 25 26 27 18 19 20 21 22 23 24 22 23 24 25 26 27 28 28 29 30 31 25 26 27 28 29 30 31 29 30 October November December Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 3 4 5 1 2 1 2 3 4 5 6 7 6 7 8 9 10 11 12 3 4 5 6 7 8 9 8 9 10 11 12 13 14 13 14 15 16 17 18 19 10 11 12 13 14 15 16 15 16 17 18 19 20 21 20 21 22 23 24 25 26 17 18 19 20 21 22 23 22 23 24 25 26 27 28 27 28 29 30 31 24 25 26 27 28 29 30 29 30 31
CISC-1600-E01 meets from 6:00 to 8:45 pm,
with a 10-minute intermission at the halfway point (7:30 pm).
CISC-1610-E01 meets from 8:50 to 9:55 pm.
In practice, however, both time slots will have a mixture of
lecture and lab work.
That’s the advantage of having a computer
on each desk in the classroom.
CISC-1600-E01 and CISC-1610-E01 meet in room 317 of Keating Hall, in the Rose Hill (Bronx) campus of Fordham University. Take the B or D subway to the Fordham Road station in the Bronx. Or take the Harlem or New Haven line of Metro North to the Fordham station.
Each student’s desk in room KE 317 has a Microsoft Windows PC.
We will use these machines to connect to the Fedora Linux server
storm.cis.fordham.edu
.
This is the computer that will actually execute our C++ programs.
We will use the
GNU
C++ compiler
/usr/bin/c++
(version 14.2.1)
to translate each C++ program
into terms that
storm
can understand and execute.
If a student has acces to a computer at home or at work,
he or she should connect to
storm.cis.fordham.edu
during the week between classes.
ssh jsmith@storm.cis.fordham.edu
jsmith
is their Fordham ID (the first part of their Fordham email address).
Terminal
application and give the same command,
ssh jsmith@storm.cis.fordham.edu
In fact, if the student’s own computer is portable, he or she can bring it to class and use it instead of the Microsoft Windows PCs in KE 317. Most people are more comfortable using their own computer.
The textbook is the many examples of C++ programs on the web at
https://markmeretzky.com/fordham/1600/src/
.
There are no programming prerequisites for CISC-1600-E01 and ISC-1610-E01, and it’s okay if the student’s typing skills are at the hunt-and-peck level. It would be helpful if the student already knew how to copy and paste text on a Microsoft Windows PC or Apple Macintosh.
The student has to be able to proofread his or her own work, and to compare their work on a character by character basis with the exmples presented in class. In this business, a typographical error of even a single keystroke can kill you.
Each homework will be a C++ program. There will be one or two assignments per week, each one due in one week. Don’t fall behind. A student should expect to spend at least three hours per week outside class on homework.
A student will submit his or her homework by posting it in the
public_html
directory of their account
on the Linux server
storm.cis.fordham.edu
.
This means that every student will be able to see the work of
every other student.
The midterm and final exam will be on paper. If the student has done their own homework reasonably successfully all semester, they will have no trouble with the midterm or final: it will just be more of the same. But if the student has plagiarized their homework all semester, or has been massively late or absent, they will fail the midterm and final. That’s obvious, isn’t it? Read the Fordham policy on lateness, absences and plagiarism.
Students will get the same grade for CISC-1600-E01 and CISC-1610-E01.
The grade for the these courses will be taken
50% from the homeworks
25% from the midterm
25% from the final exam
In practice,
a student’s grade for the homeworks and the grade for the final exam
will almost always be very similar.
If you’ve been working hard all semester,
it will show on the final.
Academic integrity is the pursuit of scholarly activity in an honest, truthful and responsible manner. Fordham students are expected to accept the responsibility to be honest and to respect ethical standards in completing their academic assignments, assessments, and other requirements. Students are expected to adhere to academic integrity by completing all assignments and other requirements on their own without assistance from external resources (including any artificial intelligence or machine-learning tools) unless directly authorized by the instructor. It is the student’s responsibility to give credit to any quotation, idea, or data used from an outside source. Students who fail to meet the responsibility for academic integrity subject themselves to sanctions ranging from a reduction in grade, course failure in the assignment, or expulsion from the University.
Some members of the Fordham community are known by a name
other than their legal name.
Students who wish to be identified by a chosen name can
email the instructor at
mmeretzky@fordham.edu
to request that their chosen name and pronoun be used.
Please also let the instructor know
if he accidentally spelled your name wrong when creating your
computer account on
storm.cis.fordham.edu
.
You can check this by typing the following Linux command on storm
.
awk -F: '$1 == "jsmith"' /etc/passwd
where jsmith
is their Fordham ID.
The tutoring center is in room 310 of JMH (John Mulcahy Hall), south of Keating Hall in the Rose Hill (Bronx) campus of Fordham. It is open Monday through Friday, 11:30 am to 3:45 pm. Drop in, no reservations are required.
There’s a Fordham Computer Science Society, too.
Here are links to the
Fordham Emergency
Medical Services
Fordham Counseling and Psychological Services
Fordham
Office of Disability Services
We have 14 × 2.75 = 38.5 classroom hours, plus 14 lab hours, to explore the following topics, in approximately the following order.
Our first C++ programs must tell the computer to produce output;
otherwise we would never know if the programs were executed correctly,
or even if they were executed at all.
We will produce three types of output:
standard output, standard error output,
and exit status.
The output will be directed to different destinations,
such as the screen of a terminal or into an output file on the disk.
Initially, our output will be in the form of a stream of characters,
including invisible characters such as
the beep (\a
),
the tab (\t
),
and the newline (\n
).
In a later example,
our output will be in the form of the pixels of an image,
each with measured amounts of the primary colors red, green, and blue.
If we couldn’t do input, our programs would be very boring because they would behave exactly the same way each time we ran them (in the absence of the random numbers coming later in the course). We will draw input from different sources, such as from the keyboard of a terminal or from an input file on the disk. Input is intrinsically more complicated than output, because the data coming in from the outside world might be garbage, against which we would have to defend ourselves.
Certain rules are imposed by the C++ language itself.
These include rules about case (uppercase vs. lowercase),
spacing (the places where white space is forbidden or required),
and punctuation marks (characters such as
(
parentheses),
{
curly braces},
and
[
square brackets]
must come in matched pairs).
The computer will reject the program
if these rules are violated.
Other rules are imposed by human convention. In English, we indent the first line of each paragraph; in C++, we indent the statements of each block. The human reader will reject the program if these rules are violated. The human also expects to see comments, invisible to the computer, embedded in the program as explanations.
A variable is a container in the computer that can contain a number, a word, a series of characters, or a logical conclusion such as TRUE or FALSE. A program must be able to create a variable, store a value into a newborn variable (via initialization), change the value in the variable (via assignment) unless the variable is a constant, and use a value that has been previously deposited into a variable.
Each variable has a name, and there are rules about what names are permitted, and what happens if two variables have the same name. Each variable has its own scope or habitat, the part of the program in which we are allowed to mention the name of the variable. Each variable also has a well defined lifetime, and is created and destroyed at precise times during the execution of the program. It would be wasteful to create the variable before we need it, or to allow the variable to stay alive after we no longer need it.
Variables such as
x
and
y
may be combined with
operators
such as
+
and
−
,
and
literals
such as
10
and
20
,
to form
expressions
such as
x+y
and
y−10
to instruct the computer to perform arithmetic
(and other more exotic operations).
These expressions are made almost unambiguous by
the rules of
precedence
(higher vs. lower)
and
associativity
(left vs. right).
For example, in the expression
1-2-3
,
which subtraction should be executed first?
Should the final result of the two subtractions be -4 or +2?
The students are warned away from the rare expressions
that are ambiguous in C++.
For example,
in the expression
f(x)+g(x)
,
which function is executed first?
And when would it matter?
This is a question of
side effects.
This is the most important part of CISC-1600, since control structure is what makes computer programming different from all other forms of human endeavor. (The only thing remotely similar to a computer program is knitting instructions, because knitting instructions have control structure.)
A program is a list of instructions;
by default, they are executed by the computer from top to bottom.
We can insert special instructions
(called
control structure)
into this list to tell the computer to skip, or to repeat,
other instructions or groups of instructions in the list.
We could even tell the computer to jump around from point to point
in the program,
but that would make the program hard to understand and debug.
Instead,
we limit ourselves to a very restricted set of stylized maneuvers,
consisting of the instructions
if
,
else
,
while
,
for
,
and
do
.
These statements let the program respond flexibly
to different inputs and different situations,
but only in familiar, conventional ways whose execution we can trace
when things go wrong.
This topic will include the crown jewel of computer programming,
“nested loops”.
Each variable in C++ can hold only one type of data. For example, one variable might be capable of holding numbers; another might be capable of holding words. And among the numeric variables, there are different types of data. One variable might be capable of holding numbers with fractions (e.g., 2½); another might be capable of holding only whole numbers. There are different types of non-numeric variables too. One variable might be capable of holding an entire word or sentence; another might be capable of holding only a single character.
What happens when we take a number with a fraction and try to store it in a variable that can hold only whole numbers? In general, what sorts of things can go wrong when we try to copy a value from one type of variable into another? And what are the tradeoffs between space and speed when selecting the different types of variables to use in our programs? This question becomes imporant when we have thousands or millions of variables, because our memory or available time might be limited.
An array is a long series of mass produced variables, all of the same data type. An array can also be two-dimensional, consisting of rows and columns of variables. When we process the variables in an array, one by one, we always use control structure to repeat the same instructions over and over again. (In other words, we have to write a loop because there are so many variables in the array.)
Let’s assume that all the variables in a given array hold numbers. There are many kinds of tasks that a C++ program might want to do with such an array. We can find the largest (or smallest) number in the array; we can rearrange the numbers into increasing (or decreasing) order; we can copy all the numbers from one array into another array. Ditto for an array that holds words instead of numbers. In fact, the instructions (i.e., the algorithm) for sorting a list of names into alphabetical order are almost identical to the instructions for sorting a list of numbers into increasing order.
[The loops that perform the most common array tasks (searching, sorting, copying) have already been written for us once and for all in the “C++ Standard Library”. This topic is outside of the scope of CISC-1600 (it’s covered in CISC-2000), but this is the instructor’s vote for what we should do with any extra time we may have left at the end of the course.]
We can package part of a program as a separate function to execute it at more than one time as the program runs. For example, a program that outputs the lyrics to a song execute a function to output the chorus at several different times as the program runs. We may also want to package various sections of a larger program as separate functions in order to break the program into pieces of manageable size.
Often we want to do more than simply execute the instructions
in a function.
We may also need to transmit information to the function.
These values passed to the function from the rest of the program are called
the
arguments of the function.
We will explore the tradeoffs between the two mechanisms
for passing arguments to a function,
pass-by-value
and
pass-by-reference.
To make sure that a function has received valid values as arguments,
it can contain
assert
statements.
The rest of the program may want to receive a resulting value,
called the
return value,
from the function.
We have the same two mechanisms for transmitting a return value
that we had for transmitting an argument.
And we can also write an
assert
statement inside the function to make sure that the return value is valid.
We will be creating our C++ programs as files on a Linux server
(storm.cis.fordham.edu
),
and will also store our files of input and output there.
We will therefore need to know the basic Linux commands for
creating, editing, saving, naming, renaming, copying, moving, and removing
files.
For example,
to type in the statements (commands) of a C++ program
and save them in a text file,
we will use the Linux editor
vi
.
To provide a foundation for the concepts of CISC-2000 in Spring 2025, CISC-1600 will emphasize certain distinctions that will become important later. For example, CISC-1600 will point out the exact limits of the scope and lifetime of a variable, because these boundaries will trigger the “constructors” and “destructors” that will play such a large role in the object-oriented programming in CISC-2000. CISC-1600 will recognize the difference between initialization and assignment, in preparation for the “operator overloading” topic in CISC-2000. And CISC-1600 will train students to program in the same style with variables of every data type, in preparation for the C++ “templates” in CISC-2000. See you again in the Spring!