What is pseudocode?
Pseudocode is a informal language
Pseudocode is one of the popular
representation of algorithm
Pseudocode
widely choose because:-
- Easy to read and
write
- Allow the programmer to concentrate on the
logic of the program
- Statements are written in simple English
- Each instruction is written on a separate
line.
- Keywords and indentation are used to
signify particular control structure.
- Each instruction is writer from top to
bottom with only one entry and one exit.
- END statement used to indicate the
algorithm is complete
- This keywords
should be capitalized (READ, WRITE, IF, ELSE, ENDIF, WHILE, ENDWHILE,
REPEAT, UNTIL).
Example:-
Definition:
Read name,hourly rate,hours
worked,deduction rate
compute gross,
deduction,net pay
is gross>=100?
YES: calculate deduction
NO: no
deduction
OUTPUT: - write
name, gross, deduction, netpay.
ANSWER in pseudocode:-
READ name, hourlyRate, Hoursworked.
Grosspay= hourlyRate * hours worked
IF grossPay>=100
Deduction=grossPay * deductionRate
ELSE
Deduction=0
ENDIF
Netpay=grosspay-deduction
WRITE name,grossPay,deduction,netPay.
ADVANTAGE OF PSEUDOCODE
- Can be done easily on a word processor
- Easily modified
-
Implements structured concepts well.
DISADVANTAGE OF PSEUDOCODE
- It is not visual
- There
is no accepted standard, So it varies widely from company to company