Computer
Computer
To
Programming
Is two 50,4 *
*③ § +381%-6%6 *
§ 's >
CHI 01
e
Introduction to programing
* computer is very powerful which can help you to solve some of the problems
that you encounter .
Types of problems
* problems don't always have staight forward solutions .
-
Some problems ,
sash as balancing a checkbook or baking a cake ,
can be solved with a
series of actions .
These solutions are called Algorithmic solutions .
.me , o-G.tw
-
The solutions of other problems ,
sash as how to buy the best stock or whether to expand
the company ,
are not straightforward .
-
solutions that cannot be reached through a direct set of steps are called
up the solution .
* computer are built to deal with algorithmic solutions which are often ,
difficult for humans .
* the field of computers that deals with heuristic types of problems is called
artificial intelligence .
programing languages
programming languages : is the median of communication between you
Advantages Disadvantages
•
executed directly .
-
difficult to use and understand .
-
( 0,1 ) .
-
Machine dependent .
•
doesn't require translator . -
difficult to find errors , debug
•
takes less time .
and modify .
-
first generation language .
-
closer to the computer .
Middle level ( assembly language ) :
- are created using symbols sash as letters , digits and special special characters .
-
We Use words called mnemonics , and there are different mnemonic for diffrent
computers architectures .
-
needs a trans later called assembler to
-
assembly code Example : SUB AX, ,
BX
-
mnemonics Example : ADD MOV SUB
, ,
Advantages Disadvantages
-
easy to understand .
→
easy to find errors , modify .
High level :
-
similar to human language grammer rules .
-
Can be understood by the User .
•
has a set of predefined words known as keywords and set of rules known
-
needs to be translated by compilers and inter p renters .
-
Example : JAVA C++ BASIC
, ,
Advantages Disadvantages
-
Writing instructions is easier . -
needs to be translated .
-
readable and understandable -
slower than the others .
change or not .
•
easy to Understand .
-
easy to creat programs .
-
✗ to find errors and modify .
-
closer to the User .
Part one
Done
Ch 't
'
2
The basic set of procedures that are followed in the program development are as follows :
-
Algorithm Design and Representation .
-
implementation ( coding ) .
-
Testing .
- Documentation .
The analysing stage allows software developers to understand and analyse the requirements of
processing -
output chart 0
the Input -
processing -
output ( 1Pa
-
What data items are input .
-
what processing takes place on that data .
-
what information will be the result that is the output .
-
Shows where in the solution the processing takes place .
>
* OH djj.WS 81 *
IPO chart for the wage
•
Number of hours ← Enter Hours -
Employee
worked NH .
Worked .
Wage .
__
Hourly pay Rate £ Enter pay Rate .
RP . -3 Calculate wage .
* print wage .
§ End .
Dart two
Done
CHI 03
-
It's defined as step by step process to get a solution in less time .
-
the most ways to represent an algorithm are preudo code and flowchart .
pseudocode
keywords from a
programming language .
Advantages :
easy to read , understand ,
and modify .
v. sJHl@i-tmdi.ss.ot3H.a -4*6 *
flowchart
flowchart : is defined as a step by step diagrammatic representation of the logic paths
to solve a problem .
Advantages :
is a
good way to communication between users .
it allows the problem solver to break the problem into parts to make a master chart .
Symbols
Example storing
: arithmetic operations .
in the algorithm .
in any direction .
Done •
Chi .
oy
Algorithm structure
any algorithm can be described using only three control structures :
control structure
"
1.
"
sequence .
2.
"
.
"
3. .
* you may have more than one control structure in one program
"
* we should put the instructions in sequnce from the tob to the bottom .
"
* it can be used when you want the computer to choose between alternative actions .
,
,
> * Js # A -6.6%6 *
Relational operators
Equl To → a ==b ,
Not Equal To → a 1. = b
Logical operators
part four And → && ,
OR → ( two vertical bars)
Done . .
Not → ! we j.wb.io *
> * ③ I
CHI 05
Repetition structure
" "
control
3. A counter initialization statement that initially sets the condition and it must , always be placed
4. A counter update statement within the repeating section of code that allows the condition to become false .
* the condition being tested either at the end beginnign or the end .
* if it's true ,
the executable statements within the loop are executed .
if it's false ,
the executable statement
Both the while and for loop are examples of sushi loops .
condition is evaluated ,
because the condition
v. Us # A jj.WS I *