CS 368: Learning a New Language

"C++ for Java Programmers"

Last updated by Karen on Nov 4, 2009


Instructor:

Teaching Assistant:


Textbook information

There is no required textbook for this class during the Fall 2009 semester.

However, if you feel you need a structured textbook to help you learn the material then one of the following may be helpful to you. Karen feels that both lack sufficent quality and quantity of examples. Please note that we will not follow the ordering or presentation of either of these text books.

  1. C++ for Java Programmers
    by Mark Allen Weiss
    published by Pearson Prentice Hall, 2004
  2. C++ for Java Programmers
    by Timothy Budd
    published by Addison Wesley Longman, 1999

You will need a reference for C++. Use a book that you already own, or ask your peers which one they like. Karen's current favorite is the fourth edition of C++ Primer Plus by Stephen Prata. Published by Sams Publishing, 2002.


Assignments

Assignments are intended to focus your learning on specific topics. For this semester, a new set of assignments is being developed, hopefully better representing an amount of work appropriate for a 1-credit class than in previous semesters.

You may work with a partner on each assignment, provided that partner is currently enrolled in the course. The pairings may be different for different assignments. Make sure that it is clear if you are working with a partner, by placing both students' names on the turned in assignment.

Assignments are due as stated on the assignment. Exceptions to due dates will be considered, if extraordinary circumstances occur and the student has discussed the situation with the instructor before the assignment's due date.

Written homeworks will be checked for completeness. Programs will be scored by the TA. Your code will be compiled and executed to determine if it works. Note that it is impossible for the TA to run test code that does not compile; therefore, it is far better to turn in partially completed code that compiles (and runs) than to turn in code that does not compile.

Your programs are expected to be able to be compiled and executed on the department's instructional Unix machines. It is expected that your programs compile on these machines without warnings or errors when using g++.


Grading

Students meeting all 3 of these requirements will receive 1 credit (a grade of CR) for the course.

  1. Attendance at at least 10 of the 14 lectures. Sign the attendance sheet at each class.
  2. Completion of all homework assignments. All questions must be attempted, and the assignment must be turned in on time.
  3. Scores of at least 70% on all programming assignments.

(Possibly) Helpful Links

C++ Programming

Introduction to Using Tools

Make

Debuggers

Purify


Schedule

It may make for less or easier note-taking, if you print the lecture slides posted, and bring them to class.

Weeks Topics Assmt Due Dates Handouts and
Lecture Notes
1: 9/2 course introduction, programming language history,
a first C++ program
lecture slides
2: 9/9 basic types, arrays, enumerations, and structures lecture slides,
code example
3: 9/16 pointer basics and pointer/array interactions Assmt 1 due (on arrays and structures) lecture slides
4: 9/23 memory model, dynamic allocation of memory, and an introduction to memory management Assmt 2 due (pointer manipulation) lecture slides
5: 9/30 the const modifier and its interaction with pointers,
function basics, including call by value and call by reference parameters
lecture slides
6: 10/7 finally: classes and objects!
.h and .cpp files,
introduction to constructors, destructors, and the copy constructor
lecture slides, and please bring a printout of:
IntList.cpp,
IntList.h,
testIntList.cpp,
Makefile
7: 10/14 Let's build a queue. Assmt 3 due (on C++ memory model and classes) the queue
8: 10/21 an introduction to overloaded operators, especially the overloaded assignment operator lecture slides on operator overloading
9: 10/28 multi-file compilation, and the Unix utilities: make, purify, and a little on debuggers Assmt 4 due (queue program) lecture slides
10: 11/4 operator overloading, friends Assmt 5 due (Makefile) lecture slides,
and please print out and bring a copy of
Polynomial.cpp,
Polynomial.h, and
testPolynomial.cpp.
Here is also a Makefile.
11: 11/11 more on operator overloading and type conversions extra lecture slides
12: 11/18 on I/O and the string class Assmt 6 due (adding memory management to the queue program) I/O lecture slides
13: 11/25 No class, THANKSGIVING
14: 12/2 templates templates lecture slides
15: 12/9 the STL Assmt 7 due (on I/O and strings) STL lecture slides
What we wish we had time for:
inheritance
inheritance lecture slides,