C/C++ Programming
San José City College CIS054
Login to Canvas

SJCC registration

assist.org Community College courses vs. University courses

Instructor: Dan McElroy
e-mail: Dan.McElroy@sjcc.edu
Dan's YouTube channel Dan McElroy's YouTube channel

 
 

 

 
Course Syllabus
CIS054 C/C++ Programming

Course Syllabus

Spring 2019
Summer 2019
Fall 2019

Spring 2018
Summer 2018
Fall 2018

  Spring 2017
Summer 2017
Fall 2017

Spring 2016
Summer 2016
Fall 2016

Summer 2015
Fall 2015

Handouts and other Goodies
ASCII Chart
Mono: Run .NET programs on Linux, Unix
DevCpp - Free Windows C++ compiler (8 Mb).
NOTE: When using DevCpp, at the end of your program,
YOU need to prompt the user to press a key, and then
read the keyboard to prevent the DOS box from closing
as soon as the program ends.

COURSE INFORMATION
The CIS054 C/C++ course is organized into modules. Each module contains one or more lecture topics and one or more lab assignments. Students are expected to spend about 9 hours on each module. This includes viewing the lectures either on video or PowerPoint, textbook readings, quizzes and lab assignments. The time commitment should be the same for an online course as an on-campus course.

This webpage contains many but not all of the links to the videos and PowerPoint presentations for the CIS054 C/C++ Programming class. Several of the lab assignments are taken from the texbook, and due to copyright restrictions are only available on the class Canvas website to students registered in the course.

M
o
d
u
l
e

Homework, Lecture and Quiz

Click Video for a video of the lecture
Click PPT for a PowerPoint of the lecture
Click for support files

Unless otherwise noted, when a link to PowerPoint slides
are on the same line as a link to a video, they both cover
the exact same information.

Lab Assignments

Click Video for a video desciption of the lab assignment
Click PPT for PowerPoint slides desciption of the lab assignment
Click Word for the lab assignment / lab report form
  Click for sample code in C or C++
Click the following link for the FAQ on a C++ end1 error Click for a Frequently Asked Question (FAQ)

0
Course Outline and Orientation
Important and Useful Information
Orientation information in a YouTube video Orientation information in a PDF file Class Orientation
Orientation information in a YouTube video Information on Canvas in a PDF file Course Navigation
Information on Canvas in a PDF file Introduction to Canvas
Orientation information in a YouTube video Tour of Canvas by Instructure
 

1

Intro to Programming in C and C++
Introduction to Programming
C and C++ Keywords
Using a Development System

Homework Reading Assignment:
Read chapter 1 - introduction and several helpful hints.

Lecture Topic #1: Hardware and software
 
Lecture Topic #2: Program organization
 
Lecture Topic #3: Naming rules and conventions
 
Lecture Topic #4: Editors, keywords, etc
 
Lecture Topic #5: The ASCII character set
 

Quiz: Chapter 1, Intro to C and C+

Homework Reading Assignment:
Choose the reading assignments depending on which
language (C or C++) you are using during the course.
  C Textbook - Chapter 1
  C++ Textbook - Chapter 1

Lab Assignment #1 - Paycheck v1.0
Learn how to get your first program to compile and run.
  Project description and lab assignment
Choose either C or C++ for the project
Paycheck project lab report form

Frequently Asked Questions (FAQ)
Click the following link for the FAQ on installing Visual Studio Installing Visual Studio
Click the following link for the FAQ on scanf_s scanf_s
Click the following link for the FAQ on C++ Precompiled header error Visual C++ precompiled header error
Click the following link for the FAQ on a C++ COFF error Visual C++ COFF error
Click the following link for the FAQ on a C++ end1 error end1 error when using C++

Click the following link for the FAQ on building a C++ program using Mac Xcode C++ with MacOS Xcode       Click the following link for the FAQ on building a C++ program using Mac Xcode C with MacOS Xcode

Click the following link for the PDF discussion file Hints for using Code::Blocks instead of Visual Studio or Xcode
Click the following link for the PlayersOnTeam lab YouTube video Video on installing Code::Blocks 7:53 (cc)


IMPORTANT! The Paycheck assignment shows how to display two
digits past the decimal. Make sure you see how this works. You will
need to set the number of digits past the decimal in several future
assignments. 

Lab Assignment #2 - Syntax and Other Errors
Recognize and documents errors when bugs are placed in a program.
  Project description and lab assignment
Syntax, Logic and Run-time Errors - Lab Report

2
 

C/C++ Language Basics
Variables and assignments, Input and Output, data types, expressions, precedence of operators

Homework Reading Assignment:
Choose the reading assignments depending on which
textbook (C or C++) you are using during the course.
  C Textbook - Chapter 2
  C++ Textbook - Chapter 2

Lecture Topic #1: C / C++ Data Types
  

Lecture Topic #2: Operators and Precedence
 
Lecture Topic #3: Console Input and Output

      C++ cout and cin
      If you are studying only C++, you can skip the
      discussion on scanf, but you should study printf

      C printf, scanf, gets
      If you are studying only C, you can skip the
      discussion on cout and cin

Lecture Topic #4: Number Systems
 

Quiz: Chapter 2, C/C++ Basics

IMPORTANT: Start a new project on Visual Studio, or Xcode, etc.
every time you start a new lab assignment.

Lab Assignment #1 - Players on a Team
Analyze a project description, make decisions using if...else if...else
Convert pseudocode into a program
 
Choose either C or C++ for the project
Players on a Team project lab report form

Lab Assignment #2 - Counting Change
Analyze a project description, create YOUR first program
 
Use the Paycheck program as a reference while you
develop the Counting Change program
Counting Change project lab report form

Lab Assignment #3 - Debugging

3

Decisions
Boolean expressions, multiway branches, exception handling basics

Homework Reading Assignment:
Choose the reading assignments depending on which
textbook (C or C++) you are using during the course.
  C Textbook - Chapters 3 and 4
  C++ Textbook - Chapters 3 and 4


Lecture Topic #1: Logical and Comparison Operators
 
Lecture Topic #2: DeMorgan, switch/case statements
 
Lecture Topic #3: Exception handling (try/throw/catch)
  (available only in C++, not C)

Quiz: Chapter 3, Program Flow


Discussion:
Privacy in the workplace

Lab Assignment #1 - Rock-Paper-Scissors
Complete a program that uses multiway branches
 
Choose either C or C++ for your lab project
Sample code in C        Sample code in C++
Rock-Paper-Scissors project lab report form

Lab Assignment #2 - Electric Bill
Analyze a project description. Convert the product description into code without the benefit of a sample program.
-- This assignment is being updated --


Frequently Asked Questions
Click the following link for the FAQ on installing Visual Studio Try Throw Catch FAQ - C++ Exception Handling
Click the following link for the FAQ on installing Visual Studio Try Throw Catch FAQ - C scanf Error Handling
Click the following link for the FAQ on installing Visual Studio Reject non-numeric and negative inputs

 

Frequently Asked Questions
Click the following link for the FAQ on installing Visual Studio input only 1 character with cin or scanf
Click the following link for the FAQ on installing Visual Studio scanf_s
Click the following link for the FAQ on installing Visual Studio scanf skips to end of the program

4

Loops
Counting loops - from 0 or 1, sentinel value loops
while loop, do...while loop, for loop, nested loops
break and continue statements

Homework Reading Assignment:
  C Textbook - Chapter 5
  C++ Textbook - Chapter 5

Lecture Topic #1: More on the if...else if...else
 
Sample code for the discussion
Code in C     Code in C++     Code in Java

Lecture Topic #2: C and C++ for loop
  Loop initialization, body and increment


Quiz:
Chapter 3, Loops

Lab Assignment #1 - Sum and Range of Numbers
Analyze a project description
Determine odd or even using if...else
Determine the smallest and largest input value
Use a while statement to loop a program
Convert pseudocode into a program
 
Choose either C or C++ for the project
Add input validation to reject negative numbers and non-numeric data.
Refer to the code for the Players on a Team project.
Sum and Range of Numbers lab report form
Extra Credit: Compute the average of all numbers and display with
two digits past the decimal place. Refer to the Paycheck project
on how to display a number with two digits past the decimal.

Lab Assignment #2 - Compute PI (using a loop)
This assignment may be replaced before assigned as a class project
PI can be computed using an infinite series of numbers.
The lab computes PI using a loop of 'n' terms.

      Compute pi C-language version (PPT/PDF)
      Compute pi C++ language version (PPT/PDF)
Compute PI project lab report form

5

Functions - Part 1
Homework Reading Assignment:
  C Textbook - Chapter 6
  C++ Textbook - Chapter 6

Top-Down Design
Predefined Functions
Header files - C vs. C++
Programmer-defined Functions
Procedural Abstraction
The 'Call' stack

Quiz:
Chapter 4, Functions

Lab Assignments:
1) Cell Phone Call (use a function)
2) Predefined functions
3) Debugging functions

6

 

Functions - Part 2
Homework Reading Assignment:
  
On Canvas

Scope and visibility
Local vs. global variables
Recursion
Overloading C++ functions

Quiz:
Chapter 4, Scope and Visibility

Lab Assignment:
1) Menu Driven Metric and English
2) Fast Food Restaurant

Discussion:
Ethics in the Computer Field

7

Functions - Part 3
Homework Reading Assignment:
  On Canvas

void Functions
Call-by-pointer parameters
Call-by-reference parameters (C++)
Using procedural abstraction
Testing and debugging functions

Quiz:
Chapter 5, More on Functions

Lab Assignments:
1) Rolling Dice
2) Length of a Line (Pythagorean)

8
Lecture Topic #1:  Introduction to Arrays
Arrays
Click the following link for the PDF discussion file
An array holds multiple data items, each of which must be the same data type.

Information from the discussion
Click the following link for the PDF discussion file Sequential Search
Code from discussion
States.txt (data file)

Lecture Topic #2:  Parallel Arrays
Java Methods
 
If you have different types of data, for example
characters for customer names and numeric data for
balances, you can use one array for the names and
another for the balances and have the same position in
each array relate to an individual customer.
Code from discussion

LECTURE TOPIC #3:  Array of Records
Javadoc documentation
Orientation information in a YouTube video
A better way is to create a structured 'record' that
contains all the information for a single customer. Then
create an array of records. Then the array can be all of
the same data type - the customer record.
Code from discussion

Quiz:
Midterm, Chapters 1-7

Lab Assignment #1: Tic-Tac-Toe Lab Assignment
Arrays
Click the following link for the PDF discussion file TicTacToe Lab Project Discussion - PPT
Click the following link for the lab assignment and lab report TicTacToe.cpp (source code - incomplete - You need to finish the program)
Click the following link for the PDF discussion file  hints on how to Check for a Winner - PPT
Click the following link for the lab assignment and lab report TicTacToe Project & Lab Report


Lab Assignment #2: Tax Table Lookup
Tax Table video
Click the following link for the Tax Table video Tax Estimator Video 16:29 (cc)

Click the following link for the PDF discussion file Tax Estimator PPT/PDF

Click the link for the sample code Tax Estimator sample C++ code
Click the link for the sample code Tax Estimator sample C code

HINTS: The lab project requires that you implement Standard Deductions using an array. I suggest that you modify the function:
   double inputDeductions(int taxpayerStatus)

  1. Ask the user to select either Standard Deduction or Itemized Deduction
  2. If itemized deductions are selected, the use the rest of the code in the function that asks for the amount of the deductions, then reads the amount of deductions from the keyboard.
  3. If standard deductions are selected, use the TaxPayerStatus (known as   s  in the inputDeductions function) to lookup the deductions from the array you create for standard deductions. You only need to create a single-dimensional array of type double that contains the amount of standard deductions. NOTE: the actual TaxPayerStatus has a value from 1 to 5 and arrays are indexed starting at 0. You need to make some adjustment when indexing into the array.

Try to complete the modifications to the Tax Estimator program on your own. You will learn a lot this way. If you are still having a problem, consult the FAQ.
Click the following link for help implementing the standard deductions Help implementing the standard deductions


Click the following link for the lab assignment and lab report Tax Estimator Lab Assignment and Lab Report

9

Accessing Files
Major changes to these assignments from previous semesters
may occur. Prepare for new material to be presented.

Homework Reading Assignment:
  On Canvas

File streams
Reading and writing files
Sequential access files
Random access files
C-fopen, rwx+
C-feof, fclose
C-fseek, unlink
C++ ifstream, ofstream
C++ eof, open, close
C++ seek

Quiz:
Chapter 6, I/O Streams

Lab Assignments:

10
 

Character and String Manipulation
Homework Reading Assignment:
  C Textbook - Chapter 7
  C++ Textbook - Chapter 8

C++ Strings vs. C Strings
Searching and manipulating C strings
Searching and manipulating C++ strings
C++ Vectors

Midterm Exam:
Chapter 8, Strings

Lab Assignments:
1) Sentence Formatting
2) String Manipulation

11

Pointers and Memory Allocation
Homework Reading Assignment:
  On Canvas

Declaring and dereferencing pointers
Memory allocation in C and C++
Returning memory to freespace in C and C++
Dynamic arrays in C and C++

Quiz:
Chapter 9, Pointers, Dynamic Arrays

Lab Assignments:
1) Reservation System (may be replaced with a new project)
2) Extra Credit Lab

12

Structures and Objects
Homework Reading Assignment:
  C Textbook - Chapter 9
  C++ Textbook - Chapter 8

Structures, unions and enumerators
Structures vs. Classes (C++)
Abstract data types
The this pointer (C++)

Quiz:
Chapter 10 - Structures and Objects

Lab Assignments:
1) Student Grading
2) Binary Search of Structured Records

13

Bit Manipulation and More on C++ Objects
Homework Reading Assignment:
  On Canvas

Masking and inserting bits
Shifting bits left and right
Friend functions (C++)
Overloading operators (C++)
Arrays and classes (C++)
Classes and dynamic arrays (C++)

Quiz:
Bit Manipulation, Overloading

Lab Assignments:
1) Date object - C and C++
2) Rational Numbers - C and C++

Discussion:
Artificial Intelligence

14

C/C++ Preprocessor C++ Inheritance
Homework Reading Assignment:
  On Canvas

File Inclusion
Macro Substitution
C++ Inheritance
C++ Polymorphism
C++ Virtual functions

Homework Reading Assignment:
15.1 Inheritance basics
15.2 Inheritance details
15.3 Polymorphism

Quiz:
Preprocessor, Inheritance

Lab Assignments:
1) Different Record Types
2a) C++ Derived School Majors
2b) C Bit Manipulation

15

Building Large Project

Separate Compilation
Multiple Header Files
The MAKE Utility
Namespaces

Quiz:
Namespaces, etc.

Lab Assignments:
1) Movie Ratings (may be replaced with a new project)
2) ADT Digital Time

16

Final and Final Project

Final Exam


 

Final Lab Project