0% found this document useful (0 votes)
4 views20 pages

LC 4

The document outlines the process of program design, emphasizing its importance in planning, error prevention, and enhancing teamwork. It details steps for designing a program, including understanding the task and using tools like pseudocode and flowcharts. Additionally, it introduces decision structures and provides examples and practice exercises for creating pseudocode and flowcharts.

Uploaded by

karimf00605
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views20 pages

LC 4

The document outlines the process of program design, emphasizing its importance in planning, error prevention, and enhancing teamwork. It details steps for designing a program, including understanding the task and using tools like pseudocode and flowcharts. Additionally, it introduces decision structures and provides examples and practice exercises for creating pseudocode and flowcharts.

Uploaded by

karimf00605
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Program Design

Techniques
Class Code: jnmqmw5

By: Asmaa AbuBakr Ali


Program Design

• Program design is the process of


planning and structuring the
development of a software
program before writing the
actual code.
• Program design provides a
roadmap to guide developers in
the creation, testing, and
maintenance of the code.
Program design steps

• The process of designing a program can be summarized in the


following two steps:
• 1. Understand the task that the program is to perform.
• 2. Determine the steps that must be taken to perform the task.
• You can use Flow chart or Pseudo code to describe the steps
before implementing the program.
Why Program Design is Important

• Prevents errors: Planning reduces the chance of bugs in the later stages.
• Saves time: A good design ensures smoother coding and fewer rewrites.
• Enhances teamwork: Provides clarity when working with other
developers.
• Ensures scalability: A well-structured design allows future modifications
or extensions.
Pseudo Code

• The word pseudo means fake, so pseudocode is fake code.


• It is an informal language that has no syntax rules, and is not
meant to be compiled or executed. Instead, programmers use
pseudocode to create models, or “mock-ups” of programs.
• It is similar to everyday English.
Flow Chart

• A flowchart is a diagram that graphically depicts the steps that


take place in a program.
• A flow chart consists of a sequence of instructions linked
together by arrows to show the order in which the instructions
must be carried out.
• Each instruction is put into a box. The boxes are different
shapes depending upon what the instruction is.
Flow Chart symbols
read more
Example

• Write a pseudo code and draw a flow chart to convert the length
in centimeter to meter.
Example

• Pseudo code:
• Input the length in centimeter (Lcm).
• Calculate the length in m (Lm) by dividing Lcm by
100.
• Print length in m (Lm)
Flow chart
Practice:
Write a pseudo code and draw a flow chart that will read
the two sides of a rectangle and calculate its area.
Practice:
Suppose a retail business is planning to have a storewide sale
where the prices of all items will be 20 percent off. Write a
pseudo code and draw a flow chart to calculate the sale price
of an item after the discount is subtracted.
Decision structure

• In a decision structure’s simplest form, a


specific action is performed only if a certain
condition exists. If the condition does not exist,
the action is not performed.
• The diamond symbol represents a true/false
condition. If the condition is true, we follow one
path, which leads to an action being performed.
If the condition is false, we follow another path,
which skips the action.
Boolean expressions using relational
operators
Example

• Write a pseudo code and draw a flow chart that will read two
numbers, determines the largest value and prints a message
with the largest value
Example

• Pseudo code:
Input the value1 and value2
If (value1 > value2)
set max = value1
Else
set max = value2
endif
Print “The largest value is”, (max)
Flow chart
Practice:
Write a pseudo code and draw a flow chart that will add a
10% bonus for the employees if the sales was greater than
50000.
Practice:
Write a pseudo code and draw a flow chart that will read 3
test scores for the students and calculate the average
score. Display the average score. Also display a
congratulation message if the average is greater than 95.
Any Questions?

You might also like