Fall 2017 - CS 135
- Note: All examples I show in class can be found in the
/home/williams/public directory &
subdirectories on bobby.
You can read them there,
but if you want to edit/compile them, you will need to copy
them to your
own directory. These files may not compile/work without
as I frequently show in class how some code will lead to
If necessary, please make the appropriate adjustments as we
- Course introduction, syllabus review, discussion of course content, expectation, guideline review, and general advice.
- Details of machine code, assembly, higher level languages. Basic SSH usage, Linux commands, editors, and a "hello world" program.
- Completion of "hello world" program.
- Basics of whitespace ignorance, statements, reserved words, identifiers, variables, assignment operator, and compiler errors.
- More vocabulary related to program, code, source code, syntax, semantics, tokens, identifiers.
- Explanation of valid identifiers & naming conventions.
- Explanation of integer data types (int, short, long, bool, char)
- Explanation of floating-point data types (float, double).
- Order of operations.
- Implicit casting.
- static_cast and C-style casting.
- Basics of strings.
- Variables and assignment.
- Declaring multiple variables.
- Initializing variables.
- Using cin for input and cout for output.
- Pre/post increment/decrement operators.
- Compound assignment operators.
- Escape sequences.
- Difference between endl and \n.
- Streams in general.
- Stream insertion & extraction operators.
- cin and cout in more detail.
- Altering cin and cout to take redirected input from files in Linux.
- Please glance over chapters 1 & 2 in the book, and spend some
additional time reading the chapter 2 sections about debugging, program
style, and form.
- Assignment 1 - Due September 25.
- cmath header.
- cin.ignore(int, char)
- Clearing input failures with cin.clear and cin.ignore
- iomanip header and functions for modifying cout output
(setprecision, fixed, scientific, showpoint, setw, setfill, left, and
- getline(cin, string)
- Beginnings of fstream header and reading input from files.
- More on file I/O.
- Please read/skim Chapter 3 in the textbook.
- Logical expression evaluation with ==, !=, >, <, >=, <=
- if statement.
- if/else statement.
- Multiple if/else in sequence.
- Nesting if statements.
- Blocks of code and variable scope.
- Logical expression evaluation of single variables or values.
- bool data type.
- Beginnings of logical operators &&, ||, and !
- Assignment 2 - Due October 4. Do not use nested
- Review of assignment 1.
- Discussion of assignment 2.
- Logical operators &&, ||, and !
- Operator precedence.
- Class cancelled, we will resume on Wednesday. Office hours on
Wednesday will be 12 PM to 12:45 PM and 2:30 PM to 5:15 PM. No change
in assignment due dates.
- Relational operations on strings.
- Short-circuit logical evaluation.
- Warnings about common errors with respect to if statements.
- Ternary operator.
- Assignment 3 - Due October 18.
- Assignment 4 - Due October 18.
- Switch/case and break.
- Please read/skim Chapter 4 in the textbook.
- while loops.
- Assignment & midterm review.
- Different ways of ending loops.
- Looping through a file.
- for loops.
- Infinite loops.
- Please read/skim Chapter 5 in the textbook.
- Assignment 5 - Due November 1. Note: Input is from a file, output is to the terminal
(not a file!). The part about finding the value to make int
overflow is now extra credit. Also, use
while (input >> n)
loop to read from the file (assuming the value read is
- Assignment 6 - Due November 1. Note: Do not staple these two assignments together.
- Function introduction.
- Function return type.
- Function parameters (by value).
- More on functions built into the C++ libraries and object functions.
- Returning from a function.
- More details on functions built into C++ libraries.
- Memory addresses and reference parameters.
- Midterm solutions.
- Passing by reference versus passing by value.
- Constant reference parameters.
- Local variables.
- Static variables.
- Top-down versus bottom-up programming and debugging.
- Function overloading.
- Assignment 7 - Due November 13.
- Default function parameters.
- Please read/skim Chapter 6 in the textbook.
- string concatenation and subscript operator.
- String functions.
- String algorithms.
- Please read/skim Chapter 7 in the textbook.
- Array introduction.
- Assignment 8 - Due November 22. UPDATE: Electronic copy due at 11:59 AM on November 27.
- Array basics.
- Arrays and memory.
- Initialization of arrays.
- Arrays and functions.
- Array review.
- Selection sort.
- Lab stuff:
- For contact details & office hours for lab instructors and the lab schedule see this page.
- For all account issues with bobby, see this page or contact the system administrator.
- All issues with using the lab computers or assistance with the exercises should be directed to a lab instructor.
- Note: The only thing the lab instructors grade is the stuff you send them. Although the instructions for the exercises show the use of
you can use whatever editor you want such as
nano (what I use),
vim or other editors. Also, although I use PuTTY as my SSH client, the
lab website/manual uses Secure Shell Client. You can use any SSH client you like.
- Exercise 1 - Due Wednesday, September 6. This exercise is about logging in, use some basic Linux commands, and turning in
exercises to the lab instructor.
- Exercise 2 - Due Friday, September 8. This exercise is about editing a file and using comments.
- Exercise 3 - Due Wednesday, September 13. This exercise is about answering basic questions about the CS lab computers & servers and
- Exercise 4 - Due Friday, September 15. This exercise is about correcting compiler errors.
- Exercise 5 - Due Monday, September 18. This exercise is about writing a basic program that does input/output and some simple
- Exercise 6 - Due Friday, September 22. This exercise is about answering questions about typecasting, arithmetic operations, and library functions.
- Exercise 7 - Due Friday, October 6. This exercise is about writing a program that will find the slope of a line.
- Exercise 8 - Due Friday, October 13. This exercise is about writing a program that uses loops.
- Exercise 9 - Due Sunday, October 15. This exercise is about writing a program that uses loops and uses input redirection.
- Exercise 10 - Due Monday, October 30.
- Exercise 11 - Due Sunday, November 12.
- Exercise 12 - Due Tuesday, November 21.
- Exercise 13 - Due Monday, December 4.