San Jose State University : Site Name


Main Content

Working in Mars Mission Control, JPL

Ronald Mak

Department of Computer Science
Spring Semester 2018

Office hours: TuTh: 3:00-4:00 PM
Office location: ENG 250
Mission Control, Jet Propulsion Laboratory (JPL)
NASA Mars Exploration Rover Mission

CS 144: Advanced C++ Programming

Section 1: Th 9:00 - 10:15 AM, room MH 233


# Assigned Due Assignment
1 Jan 29 Feb 5 Watering plans

Sample solution: WateringPlans.cpp    output.txt
2 Feb 5 Feb 12 The Monty Hall Problem

Sample solution: MontyHall.cpp    output.txt
3 Feb 12 Feb 19 War and Peace


Week Date Content
1 Jan 24 Slides: Course objectives; software to install; assignments; quizzes; exams; grading; what is C++; Hello World program

Example programs: helloworld.cpp  
2 Jan 29 Slides: Identifiers, variables, and keywords; input and output; cin input; #include and using namespace; basic data types; output field width; read from a text file; string type; assignment statements; type compatibilities and conversions; arithmetic; operator shorthand; if statement; while loops; named constants; Boolean operators; precedence rules; enumeration types; nested if statements; switch statement; increment and decrement operators; for loops; break statement; nested loops; Assignment #1

Example programs: nested.cpp
Jan 31 Slides: Predefined functions; type casting; programmer-defined functions: declarations, definitions, calls; void functions; top-down design; number translator example; scope and local variables; block scope; global constants and variables;

Savitch slides: 01 02 03 04 05
Top-down design example:
translator1.cpp   translator2.cpp   translator3.cpp   translator4.cpp   translator5.cpp
3 Feb 5 Slides: Overloading function names; call-by-value; call-by-reference; procedural abstraction; testing and debugging functions; assert macro; Assignment #2; streams; file I/O; stream name vs. file name; formatting output; output manipulators; passing streams to functions; character I/O; predefined character functions; eof function;

Savitch slides: 06 07 08
Example programs: swaps.cpp   assert.cpp
Feb 7 Slides: Character I/O; arrays; array initialization; array function parameters; multidimensional arrays; C strings; the standard string class; vectors
4 Feb 12 Slides: Assignment #2 sample solution; pointers; int vs. pointer to int; declaring and assigning pointers; pointers are addresses; address-of and dereferencing operators; new and delete operators; pointer parameters; typedef; using pointers to pass-by-reference; Assignment #3
Feb 14 Slides: Passing pointers by value and by reference; pointers and arrays; pointer arithmetic; dynamic arrays; char* and char**; C++ strings and vectors are better

Savitch slides: 09
Dynamic array examples: DynamicArray1.cpp    DynamicArray2.cpp


Advanced features of C++, including operator overloading, memory management, templates, exceptions, multiple inheritance, RTTI, namespaces, tools. We will also examine some of the features of modern C++, such as lambda expressions, smart pointers, and move semantics. We will develop interactive GUI applications and explore multithreaded programming. We’ll learn how to write efficient C++ programs that adhere to good design principles while avoiding pitfalls of the language.

Learning to program well in a language like C++ requires much practice! You should expect to write one or more programs each week. The programming assignments will become increasing more challenging during the semester.


Department policy is to enforce
all course prerequisites strictly

CS 46B and CS 49C (with a grade of C- or better in each), or equivalent knowledge of object-oriented programming and C, or instructor consent.

Recommended books

C++ How to Program, 10th edition
Paul J. Deitel and Harvey Deitel
Pearson International, 2017
ISBN: 978-9332585737
Effective Modern C++
42 Specific Ways to Improve Your Use of C++11 and C++ 14

Scott Meyers
O’Reilly Media, 2014
ISBN: 978-1491903995
The C++ Standard Library
A Tutorial and Reference, 2nd edition

Nicolai M. Josuttis
Addison-Wesley Professional, 2012
ISBN: 978-0321623218

Software to install

Eclipse is an excellent integrated development environment (IDE) to use for developing C++ programs for this class.

If you are on the Windows platform, we strongly recommend running the Ubuntu operating system (a variant of Linux) in a virtual machine.

Useful tutorials: