CS177/CS477  C++ Programming
Spring 2000

1.     Instructor

Roger Hartley, SH 148, telephone 646-1218
Office Hours: Tuesdays, 2:00 - 4:00 pm.; Fridays, 2:00 pm - 4:00pm; also by appointment.

Email: rth@cs.nmsu.edu

Web site: http://www.cs.nmsu.edu/~rth/cs/cs177

2.     Where and when

Room: SH113
Time: MWF 9:30 - 10:20 am.
For the first four or five weeks, starting with 1/19/00, the Wednesday session will be spent in the J. Mack Adams lab. SH118.

3.     Textbook:

C++ Program Design, by Cohoon and Davidson, 2nd. edition, published by McGraw Hill, 1998. The definitive guide to C++ is The C++ Programming Language (2nd. edition), by Bjarne Stroustrup, who designed the language.  While not essential for this course, this book is useful if you are going to use C++ for applications programming later. A useful reference book is the C/C++ Programmer's Reference, by Herbert Schildt, published by Osborne, 1997.

4.     Course outline

C++ is a computer language that attempts to do two incompatible things.  The first is to be an efficient implementation of the ideas in object-oriented programming.  The second is to encompass, and be sympathetic to, the ideas in the strongly-established language C.

The fact that it succeeds at all is strongly in favor of the tenacity of its designer, Bjorne Stroustrup.  Its weaknesses are largely due to the idiosyncracies of C, and not due to poor implementation.  It is the best and most-widely used object oriented language available today.

I will teach C++ as an implementation of an object-oriented language. Since the textbook, and the course, delves deeply into the language, it would be excellent to have a knowledge of  C already, or at least an imperative language like Pascal, Ada, Fortan or Basic, although it is not essential to succeed in the course.  C++ is actually not "the next C"; it is a different language. For instance although strings and arrays form C are available, I will encourage use of the string and vector classes from the standard C++ library.

So, we will study the  principles of object-oriented programming and how C++ allows implementation of these ideas.  The fundamental notions here are abstract data typing through encapsulation and data-hiding, message-passing, polymorphism and inheritance.

5.     Syllabus

The breakdown by weeks is:

[1]                   Computers, languages, compilers, software development

[2]                   Object-oriented software development: objects, classes, methods; programs as models

[3]                   Overview: C vs C++; encapsulation, inheritance, polymorphism

[4]                   Basics: variables, assignment, control flow, types, simple I/O

[5-6]                Classes, object construction, access control, method invocation, accessor functions

[7-8]                Modularity: global vs class; functions, overloading, parameters and arguments, scope

[9]                   Abstract data types: operator overloading, libraries, header files, access control

[10]                 The String and Vector classes vs C-style pointers

[11]                 Dynamic variables; new and delete, the copy constructor

[12-13]                Inheritance: modeling the IS-A relationship, base and derived classes,

[14]                 Templates: parameterized types

[15]                 The Standard Template Library

[16]                 Namespaces and exceptions

 

6.     Calendar

2000:

January : 12th: First day of class

                17th: Martin Luther King holiday – no class

21st: Last day to add

February:               

March :   6th: Mid-term test

9th: Last day to withdraw

24th: Moratorium for missing assignments

27th: Spring break starts – no class

                31st: Spring break ends – no class

April:      21st: Spring holiday – no class

May:       3rd: Take home final handed out

5th: Last day of class

                8th: Finals weeks starts, Moratorium for missing assignments

                10th: Take home final due in

                12th: Finals weeks ends

7.     Resources

The programming problems can be completed in two ways.  Either an account on our computer science SUN network will give you access to UNIX and the C++ compiler g++, or you will need access to a PC running Microsoft Visual C++ or Borland Turbo C++ at home or in the Jacobs lab.

8.     Assessment

There will be one mid-term test and a final comprehensive take-home examination. There will also be three or four lab. exercises early on in the course, that can be completed in the one hour lab session, and then five or six programming problems starting out easily and graduating to fairly hard at the end of the course. These may be started in the lab session, and completed in the student's own time. The assignment of credit is as follows:

·       Mid-term Test:  10%

·       Final:           15%

·       Lab. exercises:  10%

·       Programs:    65%

My grading is always flexible, but justice will also be done! ! The penalty for late work is that it receives a maximum C grade, but there will be two cut-off dates.  A moratorium date is included in the calendar after which, any work that is due but not handed in will receive a zero.  The first day of exam week is the last day for handing in work for credit.

9.     Graduate project

Graduate students taking 477 are required to do an extra project. The assignment of credit will be modified:

·          Mid-term test:                10%

·          Final:                       15%

·          Lab. exercises:                10%

·          Programs:                52%

·          Project:                    13%