COSC 1315 - Fundamentals of Programming
Allan Kochis


Chapter 1

  1. Flowchart Symbols


  2. Psuedo Code
    An almost English way of expressing algorithms.
    if you can't say it, you can't code it!
  3. Sequence

  4. Selection
    1. Simple if then
    2. If then else
    3. if then multiple steps

  5. Iteration
    1. while loop
    2. do .. while
    3. unstructured loops.


  6. Leap year
    A year that is divisible by 4. But it it is divisible by 100, it must be divisible by 400. 1800 and 1900 not leap years, 2000 is.
       Get a Year
       If Year is  evenly divisible by 4?
          If Year is evenly divisible by 100?
            If Year is evenly divisble by 400?
               Print Year is a Leap Year.
            Otherwise
               Print Year is not a Leap Year
            EndIf
          Otherwise 
            Print Year is a leap year.
         EndIf
       Otherwise 
         Print Year is not a leap year.
       EndIf
    

  7. Leap years 1900 to 2009
         Set the Year = 1900
         While Year is less than 2010
           If Year is  evenly divisible by 4?
              If Year is evenly divisible by 100?
                  If Year is evenly divisble by 400?
                     Print Year is a Leap Year.
                  Otherwise
                     Print Year is not a Leap Year
                  EndIf
              Otherwise 
                 Print Year is a leap year.
              EndIf
           Otherwise 
              Print Year is not a leap year.
           EndIf
           Add 1 to Year
         EndWhile
                
    
  8. Change Problem in Class/Lab