Fundamentals of Computer Science I

Principles of Computer Programming


Final projects

About

In this course we are mainly concerned with fundamental algorithmic techniques in problem solving. Additionally, we take a beginner's tour on C/C++ programming language. Substantial portions of the material for this course are presented only in lecture, so students should be regularly attend lectures.

Programming projects

Homework is made up of series of programming projects given every week. Each series consists of three or four programming projects, each one is intended for examining students skill in a particular technique in algorithmics and programming. There is not any final project nor any late time submission after the course end. Projects should be submitted before the stated deadline via SbutA. About one third of the course grade is dedicated to programming projects.

Textbook

Slides and the other materials provided in this page should be enough to qualify the course. However, the following books are just recommended as optional reference for C/C++ programming language;

C++ Primer Plus C++ How to Program Herb Schildt's C++
Programming Cookbook
The C++ Programming
Language

Development Environments

There are several IDEs for C/C++ programming, some that serve the interests of professional programmers and others that just present a minimal set of programming requirements. Among them, we recommend two freely available IDEs,

The Dev-C++ uses a Windows port of gcc that is the standard C/C++ compiler in Linux systems. Instead, the Visual C++ is bundled with an optimized C/C++ compiler for Microsoft .NET framework.

External likns


Schedule & course materials

The topic of each lecture and reading material including sample codes will be listed below.

Session 1

Introduction to the course.

History of computing and theoretical computer science.

Session 2

Introduction to computer hardware.

Universal Turing Machine and modern computers.

Terminology of algorithmic problem solving and computer programming languages.

Session 3

Computability and complexity.

Computer processors and computer memories in practice.

Session 4

Data representation in computer memory.

Two's complement representation of negative integers.

Character encoding.

Protocols for floating point.

Session 5

Introduction to flowchart.

Variables in mathematics and programming.

The simplest algorithmic approach: "input-calculate-result", simple path flowchart.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint

Session 6

Introduction to C/C++ programming language: history and prototype.

The first program: "Hello world!".

Variable declaration.

Simple iostream.

Implementation of "input-calculate-result" algorithms in C/C++.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

Session 7

Decision and branch. if ... else ...

Comparative operators.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • IDE usage. Section 1: setup, create new project, compile and run.
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

Session 8

Decision and branch. Section 2: solving quadratic equation and ...

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

projects: series 1

projects: series 2

Session 9

Decision and branch. Section 3: Logic conjunction operators.

Right triangularity.

Intervals overlapping.

Leap year.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

Session 10

Decision and branch. Section 4: Resolve complicated equations by intermediate variables.

All about calendars!

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

Session 11

Iteration loop.

Counter loop.

The C-style counter loop, for...

Compound assignment operators.

Increase and decrease operators.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

Session 12

Iteration loop. Section 2: precondition, postcondition and loop invariant.

Sum and Factorial.

Adding up a list of numbers.

Divisors and Primality.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

projects: series 3

Session 13

Iteration loop.Section 3.

Nested loops.

The while loop.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

Session 14

Iteration loop. Section 4.

Common divisors and Greatest Common Divisor.

The do...while loop.

ASCI character table.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

projects: series 4

Session 15

Review of previous topics. More details on C/C++ programming language.

Fundamental data types.

Literal constants.

How to convert characters to numeric values.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

Session 16

Review of previous topics. More details on C/C++ programming language.

Calling functions and operators.

Return values: keep or drop.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint

Session 17

Function declaration.

Actual parameter vs. formal parameter.

Void function.

Pseudo random generator, rand().

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

projects: series 5-a

Session 18

Functions. Section 2: Reference Parameter vs. Value Parameter.

Reference parameters as input/output arguments.

Software development in top-down fashion.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint

projects: series 5-b

Session 19

Arrays.

Simple applications for arrays.

Arrays as vectors in linear algebra.

Arrays as polynomials.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

Session 20

Arrays. Section 2.

Arrays as function parameters.

How to represent finite sets using arrays. Explicit approach vs. characteristic-based approach.

Set operations: membership test, intersection, union

Eratosthenes prime sieve

Computing data frequencies and histogram.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++
    > Updated <

Session 21

Arrays. Section 3: Multidimensional Arrays.

Simple matrix operations.

Khayyám-Pascal triangular array.

Array initialization using constants.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

Session 22

Strings.

C-style strings.

The object-oriented solution, string data type.

String functions and operators.

  • Slides from lecture:
    Open Office Presentation    PDF    Microsoft Office Powerpoint
  • Sample codes:
    RAR C++   

projects: series 6

> Updated <
Solution keys for problems 1-19
Thanks to Pegah Pour-Ahmad for contribution.