CIS-155 Home:
http://www.c-jump.com/bcc/c155c/c155syllabus.htm
CIS-155 C++ Samples
MSVC "Hello, World!" program
-
main.cpp
(download) in-class demo 0 -- pausing program before exiting
Program prints AB and pauses
-
wk01_main.cpp
(download) main() invokes pause() before exiting
Feb 7, 2013 -- global and local variables
-
main_01.cpp
(download) in-class demo 1 -- variables
Feb 7, 2013 -- if-else ladder
-
main_02.cpp
(download) in-class demo 2 -- if-else ladder
Feb 7, 2013 -- Assignment a1 prototype
-
main_03.cpp
(download) in-class demo 3 -- endless loop
2/6/2014 C strings, addresses, and pointers
-
main_05_string.cpp
(download) in-class demo -- function taking pointer as a parameter
2/6/2014 Flow control
-
main_06_if_while.cpp
(download) in-class demo -- if, else, and while loop
-
main_07.cpp
(download) in-class demo -- endless for(;;) loop
2/27/2014 for vs. while loop demo
-
main_01_for_vs_while.cpp
(download) these loops are not the same!
2/27/2014 integer division and modulo operators
-
main_02_modulo.cpp
(download) inserting blank lines into the output
2/27/2014 the LOGICAL NOT (!) operator
-
main_03_tmp.cpp
(download) demonstrates that result of the ! operator is zero or one
2/27/2014 function definition and declaration
-
main_04_lucky.cpp
(download) demonstrates that once declared, the function can be called from other functions
Feb 14, 2013 -- C++ expressions
-
Feb_14_13S_main_01.cpp
(download) Modulo % (integer remainder) operator
-
Feb_14_13S_main_02.cpp
(download) Equality test == operator
-
Feb_14_13S_main_03.cpp
(download) Logical NOT ! operator
-
Feb_14_13S_main_04.cpp
(download) Converting double to int
-
Feb_14_13S_main_04a.cpp
(download) Converting double to int
-
Feb_14_13S_main_05.cpp
(download) Increment ++ operator
-
Feb_14_13S_main_06.cpp
(download) logical AND || operator
-
Feb_14_13S_main_06a.cpp
(download) logical OR || operator
Feb 14, 2013 -- arithmetic if operator
-
Feb_14_13S_main_07.cpp
(download) *** This sample will not compile ***
-
Feb_14_13S_main_08.cpp
(download) Using if statement to decide how to initialize the variable
-
Feb_14_13S_main_09.cpp
(download) Using arithmetic if operator to decide how to initialize the variable
Feb 14, 2013 -- raw storage of a float data type
-
Feb_14_13S_main_10.cpp
(download) Coercing float into an int and back into float using memcpy library function
Feb 28, 2013 -- Assignment a2, Serial Julian Date prototype
-
main_wk4_a2_demo.cpp
(download) An unfinished program with minimal function declarations and definitions
Feb 27, 2014 -- Assignment a2, Serial Julian Date prototype
-
main_a2_2014_demo.cpp
(download) New: an unfinished program with minimal function declarations and definitions
if-else ladder
-
else_if_ladder.cpp
(download) C++ library character characterization functions
while loop
-
while_loop.cpp
(download) decrement and display numbers
-
while_loop_iq.cpp
(download) number guessing
for loop
-
for_loop.cpp
(download) decrement and display numbers
arithmetic if operator, aka conditional if
-
cond_if.cpp
(download) calculate parity of an int
Binary numbers
-
demo_01_ascii_byte_2_binary.cpp
(download)
A program to convert character to its binary representation
-
demo_02_ascii_byte_2_binary.cpp
(download)
A program to convert integer to its binary representation
-
demo_03_twos_complement.cpp
(download)
A program demonstrating negation algorithm
-
demo_04_int_2_bits.cpp
(download)
New: Convert number to binary notation
string input and validation
-
main_01.cpp
(download) using hexadecimal and decimal output format
New: program that converts string to uppercase
-
main_v01.cpp
(download) All functions in one file
New: header files, header guards, and multiple source files
-
to_uppercase.h
(download) Function declarations
-
to_uppercase.cpp
(download) Definitions of functions
-
main_v02.cpp
(download) main function is defined here
string input and validation using 2 source files
-
user_input.h
(download) input and validation functions are declared here
-
user_input.cpp
(download) input and validation functions are defined here
-
main_02.cpp
(download) main function is defined here
hex string to int conversion
-
main_03.cpp
(download) demonstrates usage of stringstream buffer
Serial Date class (Assignment a4)
-
SDate.h
(download) class SDate
-
SDate_main.cpp
(download) main() test driver program
New: Serial Date class (Spring 2014)
-
SDate.h
(download) class SDate -- finish the TODO pieces
-
main.cpp
(download) main function -- you need to replace this by SDate_main.cpp
-
serial_date_utility.h
(download) Header file from Assignment a2
-
serial_date_utility.cpp
(download) A mockup of serial date functions -- replace them by real functions from Assignment a2
The assert() for proactive debugging
-
main_assert.cpp
(download) Program demonstrates the use of assert()
Apr 11 -- overloaded operator<< demo
-
counter.h
(download) class Counter and overloaded operator<<
-
main_01.cpp
(download) The program demonstrates cout << object
Apr 11 -- character classification
-
main_02.cpp
(download) The program demonstrates isdigit, tolower, and switch
Apr 18 -- unformatted stream I/O
-
main_01.cpp
(download) Program demonstrates cin.get(), cout.put(), and EOF
Apr 18 -- string stream object
-
main_02.cpp
(download) Program demonstrates <sstream> header and stringstream class
Apr 18 -- how to classify characters
-
main_03.cpp
(download) Program demonstrates <cctype> header and isdigit() isalpha() ispunct() functions
Apr 18 -- how to skip digits v.1
-
main_04.cpp
(download) Program demonstrates <cctype> header and isdigit() function
Apr 18 -- how to skip digits v.2
-
main_05.cpp
(download) Program demonstrates <cctype> header and isdigit() function
Apr 18 -- how to skip digits v.3
-
main_06.cpp
(download) Program demonstrates <sstream> and <cctype> headers and isdigit() function
Apr 18 -- how to print HTML content withut tags v.1
-
main_07.cpp
(download) Program demonstrates <sstream> header and stringstream class
Apr 18 -- how to print HTML content withut tags v.2
-
main_08.cpp
(download) Program demonstrates getline() function
Apr 18 -- how to print HTML content withut tags v.3
-
main_09.cpp
(download) Program uses std::cin() to read HTML input
May 2 -- white space indentation
-
main_01_indent.cpp
(download) Program detects { } braces to print indented text
May 2 -- pointers passed to functions
-
main_02_functions.cpp
(download) Program demonstrates using pointers as function parameters
May 2 -- swap function
-
main_03_ref.cpp
(download) Program demonstrates using pointers and references
May 2 -- pointer difference
-
main_04_arithmetic.cpp
(download) Program demonstrates finding difference between two pointers
May 2 -- pointer to char
-
main_05_strings.cpp
(download) Program demonstrates pointer to char
May 2 -- writing to file and reading a file line-by-line
-
main_06_line_endings.cpp
(download) Demonstrates ofstream ifstream open() close() getline() ios::app
May 2 -- writing integers and reading integers
-
main_07_states.cpp
(download) Demonstrates ofstream ifstream eof() fail() clear() ios::trunc