Diablo Valley College Course Outline for COMSC-200 COMSC-200: Object Oriented Programming C++ Description This course provides detailed coverage of the concepts and syntax of the C++ Language. Topics include inheritance, overloaded operators, overloaded default operators, virtual functions, memory management, files, streams, templates, and exceptions. CSU, UC Prerequisite COMSC-165 or equivalent General Information Department: Computer Science Units: 4 Grade Code: Student choice Repeatability: None Max class size: 35 Number of Hours Per Semester Lecture: 54 hours Laboratory: 54 hours Objectives/SLOs Students will be able to: In lecture and laboratory A. Use correct syntax for object-oriented programming. B. Apply concepts of encapsulation, inheritance and polymorphism to problem solving. C. Apply the principle of least privilege using C++ syntax. D. Define and use container classes. E. Use dynamic memory allocation for memory management. F. Define and use friend functions and classes. G. Know when and how to apply the "const" keyword. H. Use function overloading in inheritance. I. Apply the C++ Standard Template Library (STL). J. Use the Microsoft Foundation Classes (MFC) for Windows programming. Content In lecture and laboratory A. Review of C++ basics B. Objects and classes C. Pointers, arrays, and references D. Structures, classes and unions E. Operator overloading F. Inheritance and Polymorphism G. Pointers and memory management H. Virtual functions 1. Abstract classes I. Streams and disk file processing 1. Parsing J. Function and class templates 1. Data abstraction K. Exceptions 1. Try/catch structures October 2, 2016 COMSC-200 Course Outline Page 1 of 3 COMSC-200 DVC COR, continued L. Introduction to the standard template library 1. Vectors, lists, deques, sets, and maps a. Iterators 2. Sort, swap, find, fill, and copy algorithms Methods Lecture, Laboratory, Discussion, Distance Education Assignments Reading 1: Review the chapters on C++ programming basics, including variables, data types, sequential processing, branching and looping, void and value-returning functions, and pointers. Reading 2: Read the chapter on polymorphism, with focus on virtual functions, abstract classes, and C++ syntax for their implementation. Writing, problem solving, performance 1: Write a class named Shortest Route, to determine the shortest route between San Francisco and New York City. Potential routes are to be encapsulated in Route objects, each of which consists of an array of connecting Leg objects. The class is to include two recursive functions -- the first is simple, and just finds a valid route through the network, without regard to the shortest distance. The second finds the shortest route. Use "friend" relationships among the classes for access to private data members. Writing, problem solving, performance 2: Write a program that simulates the operation of a bank of elevators in a multi-floor building. The purpose of the simulation is to test your elevator design (number, capacity, and speed), to see if it is adequate for your building with its average rider arrival rate. Your design objective is to include the "right" speed, size, and number of elevators for your building, for your chosen arrival rate of riders, and your number and location of floors. Your simulation should appear to reach a "steady state" (without accumulating large crowds of riders on the floors) after 10 minutes or so. You may have to adjust your elevator configuration (number, size, speed). Design and use Rider objects, Elevator objects, Floor objects, and a Building object. Use public accessor and mutator functions for communication among objects. Lab, field activity, product or report: Using Visual Studio, create a dialog-based MFC application that uses the six shape classes that you created and tested in earlier console-based lab work. Show that the classes are independent of the user interface in which they are placed. A user of your Windows program should be able to select one of the six shapes, enter dimensions, and click a "calculate" button to view volume and surface area. Evaluation Sample One: Using the STL, write C++ code to print the largest value in an int vector (declared as a vector of ints). Assume that the vector is not empty. Assume that all of the required includes already exist. Sample Two: The static void member function fun() of the class X contains the throw "Ouch"; statement, which it executes in the event that it is unable to perform its task successfully (whatever that task may be). Write C++ statements to call this function, and if it causes an exception, print the phrase "NO FUN" to cout. Assume that all required include directives and declarations already exist. Frequency of Evaluation: Evaluations will adhere to the DVC "Fairness in Grading" guidelines and will include as a minimum: (1) Evaluation of students within the first quarter of the course and notifying student of the results (2) Counting a final examination for no more than one-half the course grade (3) Basing final grades on at least three students' tests and/or reports. Sample Textbook See the current course syllabus or bookcenter.dvc.edu for the actual course textbook. Book One: Author: Deitel, Harvey and Paul Deitel October 2, 2016 COMSC-200 Course Outline Page 2 of 3 COMSC-200 DVC COR, continued Title: C++ How to Program, 9th Edition Publisher: Helen Kow City: Pleasant Hill, CA Year: 2013 Book Two: Author: Balagurusamy, E. Title: Object Oriented Programming With C++, 6th Edition Publisher: Prentice Hall City: Upper Saddle River, NJ Year: 2013 Approval Date Sep 17 2014 October 2, 2016 COMSC-200 Course Outline Page 3 of 3