Python Notes
Python Notes
Example 1: Write pseudo code that reads two numbers and multiplies them together and print out
their product.
Read num1 , num2
Set multi to num1*num2
Write multi
Example 2: Write pseudo code that tells a user that the number they entered is not a 5 or a 6.
Read isfive
If(isfive = 5)
Write "your number is 5"
Else if (isfive = 6)
Write "your number is 6"
Else
Write "your number is not 5 or 6"
Example 2: Write pseudo code that performs the following: Ask a user to enter a number. If the number is between 0 and 10,
write the word blue. If the number is between 10 and 20, write the word red. if the number is between 20 and 30, write the
word green. If it is any other number, write that it is not a correct color option.
Write "Please enter a number"
Read colornum
If (colornum >0 and colornum <= 10)
Write blue
else If (colornum >10 and colornum <= 20)
Write red
else If (colornum >20 and colornum <= 30)
Write green
else
Write "not a correct color option"
Advantages of Pseudocode
• Improves the readability of any approach. It’s one of the best approaches to start implementation
of an algorithm.
• Acts as a bridge between the program and the algorithm or flowchart. Also works as a rough
documentation, so the program of one developer can be understood easily when a pseudo code is
written out. In industries, the approach of documentation is essential. And that’s where a pseudo-
code proves vital.
• The main goal of a pseudo code is to explain what exactly each line of a program should do, hence
making the code construction phase easier for the programmer.
- Start / Stop
- Input/ Output
- Process
- Decision
- Control Flow
- Connector
Algorithm
1.Initialize sum = 0 (process)
2.Enter the numbers (I/O)
3.Add the numbers and store
the result in sum (process)
4.Print sum (I/O)
1) Sequence
2) Selection
3) Repetition
pseudo-code for a simple program that calculates the total amount payable when
you include the hourly and hourly rate
Begin
input hours
input rate
pay=hours*rate
print pay
End
• The Software Development Life Cycle (SDLC) is a structured process that enables
the production of high-quality, low-cost software, in the shortest possible
production time.
• The goal of the SDLC is to produce superior software that meets and exceeds all
customer expectations and demands.
• It consists of a detailed plan describing how to develop, maintain, replace and alter
or enhance specific software. The life cycle defines a methodology for improving
the quality of software and the overall development process.