Girl Programming    
Computer Programming Concepts
Valencia College
Orlando, FL 32811

Streaming Video Lectures On-Demand 

This is a first course in computer programming.  The C language is used, along with the free programming tools from Microsoft - Visual C++ Express.  This course is suitable for those who do not know any programming languages.  It has no pre-requisites, and is suitable for college students, and high-school students who have completed high school algebra.

Professor Colin Archibald, PhD  (Dr. A)
CArchibald@valenciacollege.edu


   
  Video Lecture
 Segments

    Power Point slides that are used in these Video Lectures are available  here:           

 Download PowerPoint Slides




Video Lecture Segments
With Captions


01 Getting Started

15 mins.

  • nSyntax – rules for writing a computer program in a particular language.
  • nErrors in Syntax are called compile-time errors because they are reported by the compiler.
  • nOutput – information that originates in the program and is output to a screen, or a file.
  • nYou must get a simple program to run at this point – all subsequent segments depend on your ability to experiment with the concepts that are introduced.
01 Getting Started

15 mins.



<< Open Captions >>
02 Variables and Data Types

20 mins.

  • nVariables – named locations that hold a piece of data. 
  • nData type – the type of data that can be put in a variable.      int  double
  • nNaming rules and conventions.
  • nAssignment operator = pronounce it “gets” not “equals.”

02 Variables and Data Types

20 mins.



<< Open Captions >>
03 Input Output

20 mins.

  • nOutput:  information going from the program to the user
  • Input:  information going from the user to the program
  • nprintf and scanf
  • n% sequences correspond to the variables that are being input or output. 
  • nDon’t forget the & on the variable name for input!
  • nA "Prompt" is a message that tells the user what the program is expecting them to enter.
03 Input Output

20 mins.



<< Open Captions >>
04 Arithmetic Operators

25 mins.

  • nThere are 5 arithmetic operators + - (* / %)
  • n% is the modulus (remainder) operator
  • a % 0  Zero as a right operand of % will cause a run-time error.
  • Operators have a data type, int vs. double division.
  • nMultiplicative operators * / % have higher precedence than additive operators  +  -
04 Arithmetic Operators

25 mins.



<< Open Captions >>
05 Problem Solving

35 mins.

  • nThe solution to an problem specification can be developed by creating a more formal representation called an IPO.
  • nAt least one Test Case should be created with Expected Results before you start writing code.
  • nPrograms should be documented with "comments" that help the reader of the program to understand the code.
05 Problem Solving

35 mins.



<< Open Captions >>
06 Selection if-else

30 mins.

  • Selection – execute lines of code based on a condition
  • Relational operators are used to compare two things with a result of TRUE or FALSE
  • Relational operators are used to compare two things with a result of TRUE or FALSE
  • if statements are used to change the flow of control, the lines of code that will execute
  • if statements may have an associated else
  • if and else control one statement or one "compound statement" {  }
06 Selection if-else

30 mins.



<< Open Captions >>
07 Problem Solving with Selection

40 mins.

  • nBuild enough test cases to thoroughly understand the problem, and test the program.
  • nTest the boundaries of the specification.
  • nAn interactive debugger can be used to see exactly what your code is doing.
  • nSoftware will go through a test phase where Quality Assurance engineers will try to verify correctness or identify problems with the software.
  • nHave the specification and IPO beside you while programming.
07 Problem Solving with Selection

40 mins.



<< Open Captions >>
08 Repetition - while

40 mins.

  • nSequence, Selection, Repetition (looping)
  • nCounter and Sentinel controlled loops
  • 1. Start   2. Stop    3. Get there
  • Counter variables, Accumulator variables
  • Use a test case, and step through the code in the debugger to see its behavior
08 Repetition - while

40 mins.



<< Open Captions >>
09 Logical Operators

25 mins.

  • There are three logical operators:
     And  &&      Or  ||       Not ! 
  • Can be used to express more interesting conditions

  • Precedence Not, And, Or

  • True and False are numeric in C

  • Short-circuit behavior && ||

  • No short-circuit  &  |

09 Logical Operators

25 mins.



<< Open Captions >>
10 Mixed Type Expressions

20 mins.

  • Operators and literals have a data type
  • Operators work on operands of the same type

  • The data type of the operators is determined at the time the operator is to be executed

  • The type of the operator is determined by the type of the operands

  • C will promote, to avoid losing data

  • Programmers should demote explicitly

  • Type casting is used to temporarily change the type of a value for the purpose of evaluating an expression
10 Mixed Type Expressions

20 mins.



<< Open Captions Transcribed by:
Brandy Mackey >>
11 Problem Solving with Repetition

65 mins.

  • Use the debugger to solve problems with loops

  • Sentinel controlled loop – use priming read

  • Counter controlled loop – when you can tell from the specification how many times the loop will go (may be variable, n times. )
11 Problem Solving with Repetition

65 mins.



<< Open Captions >>
12 Short-cut Operators

15 mins.

  • New Operator: compound Assignment +=

  • a = a + b; a += b; often used for accumulators

  • New Operators: increment ++ decrement --

  • Pre, and post increment and decrement
    ++ and -- break the usual rules of precedence.
12 Short-cut Operators

15 mins.



<< Open Captions >>
13 More Loops do-while, for

20 mins.

  • Two new loops:

  • do-while
    Post-test loop - generally frowned upon, but may be useful in some circumstances – when you learn the status of the stop condition in the body of the loop.

  • for
    Used for counter controlled loops. Very commonly used.
    Use while for sentinel controlled loops.
13 More Loops do-while, for

20 mins.



<< Open Captions >>
14 Switch

15 mins.

  • A switch can be used to selectively execute some statements based on the value of a variable, or expression.

  • The break; statement prevents the execution from 'bleeding' into the next case.

  • The default case is optional, and if present is executed if none of the other cases match.

  • The cases must all be unique, and constant.

  • Switch cannot be used to compare doubles, or to express a range of values – sometimes you need to use multiple if-else statements.
14 Switch

15 mins.



<< Open Captions >>
15 Problem Solving with Repetition and Selection

65 mins.

  • #define is used to create named constants – these are not variables.

  • Choose variable names carefully.

  • Always have some test cases that demonstrate the expected result for the problem you are solving.

  • Develop the solutions progressively.

  • Compile frequently – isolate compiler errors.

  • Use the debugger to find logic errors – the program cannot hide anything from you.

  • Use for loops for counter controlled loops.

  • Use short-cut operators where appropriate.
15 Problem Solving with Repetition and Selection

65 mins.



<< Open Captions >>




16 More Data Types

15 mins.








  • The char data type can be used for small numbers, or the ASCII code of a character.

  • The sizeof operator can be used to determine the size of a variable, or a data type.

  • The choice of a data type depends on whether you need character, real or integer data && how large the values might be that you are computing with.

  • The unsigned modifier allows you to use an integer data type for positive values only.

  • Mixed data type expressions, including cast operators, apply to these new data types in the same way as with int and double.

  • printf and scanf are very strict about the % format characters which must match the data type of the variable.

  • There are different versions of C that have other data types.




16 More Data Types

15 mins.



<< Open Captions >>






17 Arrays

35 mins.




  • The indexes of an array start with 0 (zero).  Eg. an array with 10 elements has indexes 0 – 9

  • A one-dimensional array is sometimes called a "List"

  • A 2-D array is a "Table"

  • Arrays can be of any data type – elements are used as if they are simple variables of that type

  • A defined constant can be used to make your program easier to modify and maintain.

  • This for loop is very commonly used to touch the elements of an array

    for ( i = 0; i < SIZE; i++){ // loop to each element
        array[i] = …




17 Arrays

35 mins.




<< Open Captions by Susie Armstrong>>
18 Problem Solving with Arrays

70 mins.


  • Working with arrays often requires a picture to help you think about the loops that access the elements of the array.

  • Program progressively. Compile and run the code often.

  • Always have at least one good test case that is the target result.

  • Good variable names are more important when the problems become more complex.
18 Problem Solving with Arrays

70 mins.



<< Open Captions >>
19 Functions and Decomposition

25 mins.

  • Hierarchy charts are used to organize anything complex including C programs

  • There are many functions already defined for you, eg. scanf, printf.

  • We define functions to 'divide and conquer' – solve more complex problems.

  • Define functions that achieve 1 (one) well define objective – name the function carefully

  • General form for defining a function:
         returnDatatype functionName( type parameter, type parameter) {
               body of function
         }

  • General form for calling a function:
         resultReturned = functionName( argument, argument );
19 Functions and Decomposition

25 mins.



<< Open Captions >>
20 Problem Solving with Functions

50 mins.

 

  • Determining how to break the problem into functions can take practice.

  • Functions should do only one thing – and should have some documentation that describes what it does.

  • Work progressively: solve small problems - and only move on when those are correct.

  • Decide what information needs to be passed into the function and what information needs to be passed back to the caller also requires practice. "coupling"

  • Functions should be created so that they can be re-used in other applications.

  • The syntax for passing arrays to functions is tricky. Until you have practiced this several times, keep a working example nearby for reference.

  • Concept not covered: Pointers
    Pointers are important, but the implementation is very specific to the C, C++ languages.

20 Problem Solving with Functions

50 mins.



<< Open Captions >>
Appendix  
Appendix 1: Installing Visual C++ Express 2010

10 mins.
Appendix 1: Installing Visual C++ Express 2010

10 mins.

<< Open Captions >>
Appendix 2: Binary Numbers

30 mins.

 

  • Decimal number system, base 10

  • Binary number system, base 2

  • A Byte has 8 bits

  • One byte can hold values 0 – 255

  • Bytes can be combined to represent larger values.

  • Converting from decimal to binary, and binary to decimal.

 

Appendix 2: Binary Numbers

30 mins.



<< Open Captions >>

Appendix 3: Hexadecimal Numbers

25 mins. 

 

  • Hexadecimal (hex) uses Base 16.

  • Hex is an easier way to represent binary numbers.

  • 4 bits can be represented in one hex place

  • Conversion between binary and hex is very quick.

  • All programmers must know how to represent numbers in binary and hex.

 

Appendix 3: Hexadecimal Numbers

25 mins. 

<< Open Captions >>