Programming: Lesson 1. Course Overview. Introduction To Programming
Programming: Lesson 1. Course Overview. Introduction To Programming
Course 2
Basic elements of the C programming language.
overview Structure and syntax of C programs. Function
main(). Data types and variables.
3
Data input and output. scanf () and printf ()
functions. C++ input and output
4
C expressions and operators. Operands and
operators. C keywords and library math
functions. Simple and Composite (Structured)
expressions. Priority of operations.
Course 5
Selections. If and switch. Variations. Nested if.
overview Implementation.
Relational operations
Logical experssions and functions.
5
Loops. Counted controlled and condition-
controlled loops. Pre and post conditions. Nested
loops. Applications.
6
Course Arrays. Arrays declaration and initialization.
Assigning values to array’s elements. Displaying
overview
array content. Algorithms for one- and two-
dimensional arrays processing. Sorting arrays.
7
Pointers. Operations & and *. Operations with
pointers. Arrays and pointers. Operations with
pointers on arrays. Arrays of pointers. Pointer to
the array. Equivalent notations.
Course
8
overview User defined Functions. Function body, definition
and call. Values return, Function parameters. Data
exchange between functions. Local and global
variables. Time of existence and visibility. Memory
classes.
9
Methods of memory allocation in C. Standard
allocating, reallocating, and free dynamic
memory. Dynamic assignment of one-
dimensional and two-dimensional arrays
Course 10
Character processing. Read and display
overview characters. Standard character processing.
String processing. Array of chars and string in C.
Operations on strings and arrays of char. Input /
output data. Functions to process strings.
11
File Processing Pointer to file. Opening and
closing a file. Standard functions for file
processing
12
Recursion. Introduction. Recursive functions.
Course When to use recursion? Direct and indirect
overview recursion. Recursive problem solving.
13
User data Types. Structures. Access to structure
elements (fields). The typedef statement. Unions.
Bit maps. Enumerative types. Arrays of structures
processing.
Course 14
C-preprocessor directives. Macro Definition and
overview pseudo function. Conditional compilation.
Arguments of the main () function.
Seminars
1
Project 1. Hello World
1.1 Data input / output
1.2 User scanf and user printf
1.3 Formatted output
1.4 Draw in pseudographics
Course
overview 2
Project 2 Simple algorithms
2.1 Babylon algorithm for square root
2.2 Euclid's algorithm for GCD
2.3 Prime numbers
2.4 Perfect numbers (the sum of divisors)
3
Project 3. Long numbers operations (Arrays)
3.1 Big numbers sum
3.2 Big numbers difference
3.3 Big numbers multiplication
Course
overview 4
Project 4. Slow sorting algorithms
4.1 Bubblesort
4.2 Insertion sort
4.3 Selection sort
4.4 Time estimation and counting
5
Project 5 Combining arrays
5.1 3x3 0 – X game
5.2 infinite Ran Zee game
5.3 Snake
Course
overview 6
Project 6. Bit by bit
6.1 binary arithmetic + power 2 fast calculation
6.2 binary logics
6.3 Logical function evaluation
Project 7 Characters processing 1:
7.1 Development of string operation and conversion
functions
7.2 Proto Zuma game development
Course
overview Project 8 Characters processing 2
8.1 reading and editing text from file
8.2 formatting text files
Team projects
Project 1. Groups of 5. Random numbers generators
(October 10)
Problem-Solving Phase
Analysis — Understand (define) the problem.
General Solution (Algorithm) — Develop a logical sequence of
steps to be used to solve the problem.
Test — Follow the exact steps as outlined to see if the solution
truly solves the problem.
Implementation Phase
Specific Solution (Program) — Translate the algorithm into a
programming language (code).
Test — Have the computer follow the instructions. Check the
results and make corrections until the answers are correct.
Use — Use the program.
The computer, alas, is not intelligent. It cannot
analyze a problem and come up with a solution. The
programmer must arrive at the solution and
communicate it to the computer.
Meditations...
The problem solving is done by the programmer —
not the computer.
Algorithms
1. Insert the key.
2. Make sure the transmission is in Park (or Neutral).
3. Depress the gas pedal.
4. Turn the key to the start position.
Start the car 5. If the engine starts within six seconds, release the
key to the ignition position.
6. If the engine doesn't start in six seconds, wait ten
seconds and/repeat steps 3 through 6 (but not more
than five times).
7. If the car doesn't start, call the garage.
1. Lift hand.
2. Move hand to right side of book.
Go to next 3. Grasp cover of top page.
page (reffers 4. Move hand from right to left until page is
to a book) positioned so that what is on the other side
can be read.
5. Let go of page.
- In computer systems, an algorithm is basically
an instance of logic written in software by
Computer
software developers, to be effective for the
Algorithm
intended "target" computer(s) to
produce output from given (perhaps null) input.
Algorithms
After developing a general solution, the programmer "walks through" the
algorithm by performing each step mentally or manually. If this testing of the
algorithm doesn't produce satisfactory answers, the programmer repeats
the problem-solving process, analyzing the problem again and coming up
with another algorithm. Often the second algorithm is just a variation of the
original one.
Assembly
language
- A low-level programming Language in which a
Assembly mnemonic is used to represent each of the
Language machine language instructions for a particular
computer.
An instruction in assembly language is in an easy-to-remember form called
a mnemonic (pronounced "ni-mon'ik"). Typical instructions for addition
and subtraction might look like this:
The only problem with assembly language was that intinctions written in it
could not be directly executed by a computer. So a program called the
assembler was written to translate the assembly language instructions
into machine language instructions (machine code).
A program in a high-level language is called a source program. When the source program is compiled by
running the compiler with the program as data, a machine language program called an object
program results. The object program can be run directly on the computer.
Notice that compilation/execution is a two-step process. During the compilation phase of the process, the
computer is running the compiler program.
To the compiler program, a source program is just input data. The compiler program outputs a machine
language translation of the source program. In the execution phase of the process, the machine language
version of the program (object code) replaces the compiler program in the computer's memory. The
computer then runs the object program, doing whatever the program instructs it to do.
Switches to
input...
Output lights in
another room
mid 1970
Punched cards to
input...
No HDD