Programing Fundamentals Lecture (1,2) Notes
Programing Fundamentals Lecture (1,2) Notes
NOTES
COMPUTER
Computational machine
Processing device
Process the data which is in digital language (0,1)
When someone provide data to the computer for specific task it is
firstly converted into the Digital language or a language which is
understood by the computer. For this purpose, compiler is used.
COMPILER
Converter
Basically an Interpreter
Converts human language into the machine language
(Assembly language)
There are many compilers available on the internet or windows
have some of them preinstalled
CONVERTED FORM
CODE, PROGRAM COMPILER
0,1
CODE(PROGRAM)
Set of instructions
In program sequence matters
Code must be in generalized form
Processor convert assembly language to machine language
PROBLEM SOLVING
Express the solution in term of instruction
Method which is used to solve problem is known as algorithm
ALGORITHM
Algorithm is a generalize procedure
It is used for solving a particular problem
It takes input form the user and produce output
Algorithms of different people can be same but there will be same
result of the different algorithms
Qualities of a good Algorithm
1. Input and Output should be defined properly
2. Steps must be clear and unambiguous
3. Algorithm must be in generalized form (to the point, no
extra things which the problem does not require)
4. It should not include codes
5. Should be written in such way that it can be understood in
any computer language
6. Algorithms are used in different projects like in university
final year projects or representation of you programs so
instead of writing codes in your slides we should have an
over view in slides in form of Algorithm because the
reviewer can be anyone
FLOW CHARTS
Flow charts are diagram which are used to represent flow
of process
In flow chart the direction is much important. It should be
in one direction
Symbols
Oval (Start and End)
Parallelogram (Input and Output)
Diamond (Decision)
Rectangle (Processing)
What is Variable?
Container
Data saver
Memory location in C
EXAMPLES
Programming levels
Compiler:
Translate statements into Assembly language. Which
are directly understood by the computer.
Types:
1. Assembly language
2. Machine language
Operating System
Layers of Software
Important to interact with the hardware
Controls all operation
I/O operation are performed by OS
Manage computer services
Handle the order and execution of the program
Examples:
Windows
Linux
Unix
Mac OS
Good operating system
Support different hardware Architecture
Better utilization of resources and execution time
Power utilization
Compiling Program
C Programming
Case sensitive
Line spacing doesn’t matter in C language
C is a powerful general-purpose programming language
Used to develop operating system, compiler, databases
First C program
#include<stdio.h>
int main ()
{
Printf (“My name is Shuja\n My father name is Qurban Hussain”);
Return 0;
}
Output:
My name is Shuja
My father name is Qurban Hussain