CS 368: Learning a New Language

"C++ for Java Programmers"

Last updated by Karen on Feb 2, 2010


Instructor:

Teaching Assistant:


Textbook information

There is no required textbook for this class during the Spring 2010 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. Perhaps you can get by using online materials, but if you plan to program in C++ in the future, you will want some sort of reference materials of your own.


Assignments

Assignments are intended to focus your learning on specific topics.

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. Also make sure that both partners have copies of all code used (turned in) for an assignment, as further assignments depend on earlier ones.

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 programming assignments #4 and #6.

(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: 1/20 course introduction, programming language history,
a first C++ program
lecture slides
2: 1/27 basic types, arrays, enumerations, and structures lecture slides,
code example
3: 2/3 pointer basics and pointer/array interactions Assmt 1 due (on arrays and structures) lecture slides
4: 2/10 memory model, dynamic allocation of memory, and an introduction to memory management Assmt 2 due (pointer manipulation) lecture slides
5: 2/17 the const modifier and its interaction with pointers,
function basics, including call by value and call by reference parameters
lecture slides
6: 2/24 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: 3/3 Let's build a queue. Assmt 3 due (on C++ memory model and classes) the queue
8: 3/10 an introduction to overloaded operators, especially the overloaded assignment operator lecture slides on operator overloading
9: 3/17 multi-file compilation, and the Unix utilities: make, purify, and a little on debuggers Assmt 4 due (queue program) lecture slides
10: 3/24 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.
- Spring Break
11: 4/7 more on operator overloading and type conversions extra lecture slides
12: 4/14 on I/O and the string class Assmt 6 due (adding memory management to the queue program) I/O lecture slides
13: 4/21 No class???
14: 4/28 templates templates lecture slides
15: 5/5 the STL optional Assmt 7 due (on I/O and strings) STL lecture slides
What we wish we had time for:
inheritance
inheritance lecture slides