SlideShare a Scribd company logo
PROGRAM DESIGN
Higher Computing Science
DESIGN
• The modular design of a software solution can be carried out in three
stages:
• Top level design
• the main steps that the program will carry out
• each of the main steps will become a sub-program
• Data flow
• shows the data that flows IN and OUT of each sub-program
• data IN – will be passed as a parameter from the main program into the sub-
program
• data OUT – will be returned from the sub-program back to the main program
• Refinements
• a break down of each of the main steps from the top level design
DESIGN EXAMPLE 1
Design a program that displays the leading driver in the Formula 1
championship. The program should:
• read the driver name and their number of points from a file
• work out the driver with the most points
• display the leading driver, and their number of points
TOP LEVEL DESIGN
(STRUCTURE DIAGRAM)
Leading
driver
Read drivers
and points
from file
Work out driver
with most
points
Display
leading driver
and their
points
DATA FLOW (STRUCTURE DIAGRAM)
Leading
driver
Read drivers
and points
from file
Work out driver
with most
points
Display
leading driver
and their
points
driver
array
points
array
points
array
position position
driver
array
REFINEMENTS (STRUCTURE DIAGRAM)
Leading
driver
Read drivers and
points from file
Work out driver with
most points
Display leading
driver and their
points
Open
drivers
file
Loop for
drivers
Read name
into array
Read
points into
array
Close
drivers
file
Set max
to
points[0]
Loop for
remaining
drivers
Display
driver[position]
Display
points[position
]
points >
max?
set max to
points
store position
DESIGN EXAMPLE 2
Design a program that asks the user to enter the temperature for 7 days,
and then calculates the highest and lowest temperatures.
TOP LEVEL DESIGN (PSEUDOCODE)
1. Get daily temperatures
2. Calculate highest temperature
3. Calculate lowest temperature
4. Display highest and lowest temperatures
DATA FLOW (PSEUDOCODE)
1. Get daily temperatures
• OUT: array of temperatures
2. Calculate highest temperature
• IN: array of temperatures
• OUT: highest temperature
3. Calculate lowest temperature
• IN: array of temperatures
• OUT: lowest temperature
4. Display highest and lowest temperatures
• IN: highest temperature, lowest temperature
REFINEMENTS (PSEUDOCODE)
1. Get daily temperatures
1.1 LOOP 7 TIMES
1.2 GET daily temperature FROM KEYBOARD
1.3 STORE daily temperature IN temperatures_array
REFINEMENTS (PSEUDOCODE)
2. Calculate highest temperature
1.1 SET highest_temp TO 1st element in temperatures_array
1.2 LOOP WITH counter FROM 2nd array element TO 7th array element
1.3 IF temperatures_array[counter] > highest_temp THEN
1.4 SET highest_temp TO temperatures_array[counter]
1.5 END IF
1.6 END LOOP
REFINEMENTS (PSEUDOCODE)
3. Calculate lowest temperature
1.1 SET lowest_temp TO 1st element in temperatures_array
1.2 LOOP WITH counter FROM 2nd array element TO 7th array element
1.3 IF temperatures_array[counter] < lowest_temp THEN
1.4 SET lowest_temp TO temperatures_array[counter]
1.5 END IF
1.6 END LOOP
REFINEMENTS (PSEUDOCODE)
4. Display highest and lowest temperatures
1.1 DISPLAY highest_temp
1.2 DISPLAY lowest_temp

More Related Content

What's hot

Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
Vinod Kumar
 
toolbox and its properties in the visual basic
toolbox and its properties in the visual basictoolbox and its properties in the visual basic
toolbox and its properties in the visual basic
adarsh-kaul
 
Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examples
Gautam Roy
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
Vivek chan
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
Swapnali Pawar
 
Software concepts ppt
Software concepts pptSoftware concepts ppt
Software concepts ppt
Prof. Dr. K. Adisesha
 
Mathematics Function in C ,ppt
Mathematics Function in C ,pptMathematics Function in C ,ppt
Mathematics Function in C ,ppt
AllNewTeach
 
Namespaces
NamespacesNamespaces
Namespaces
Sangeetha S
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
farwa waqar
 
Oracle Database Trigger
Oracle Database TriggerOracle Database Trigger
Oracle Database Trigger
Eryk Budi Pratama
 
Data types in c++
Data types in c++ Data types in c++
Data types in c++
RushikeshGaikwad28
 
Aggregate function
Aggregate functionAggregate function
Aggregate function
Rayhan Chowdhury
 
2.software requirement specification
2.software requirement specification2.software requirement specification
2.software requirement specificationDeepak Sharma
 
System programming
System programmingSystem programming
System programming
jayashri kolekar
 
Introduction to Repetition Structures
Introduction to Repetition StructuresIntroduction to Repetition Structures
Introduction to Repetition Structures
primeteacher32
 
file handling c++
file handling c++file handling c++
file handling c++Guddu Spy
 
System Programming Unit III
System Programming Unit IIISystem Programming Unit III
System Programming Unit IIIManoj Patil
 

What's hot (20)

Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
 
toolbox and its properties in the visual basic
toolbox and its properties in the visual basictoolbox and its properties in the visual basic
toolbox and its properties in the visual basic
 
Flowchart pseudocode-examples
Flowchart pseudocode-examplesFlowchart pseudocode-examples
Flowchart pseudocode-examples
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
 
SQL JOINS
SQL JOINSSQL JOINS
SQL JOINS
 
Software concepts ppt
Software concepts pptSoftware concepts ppt
Software concepts ppt
 
Mathematics Function in C ,ppt
Mathematics Function in C ,pptMathematics Function in C ,ppt
Mathematics Function in C ,ppt
 
advanced sql(database)
advanced sql(database)advanced sql(database)
advanced sql(database)
 
Namespaces
NamespacesNamespaces
Namespaces
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Oracle Database Trigger
Oracle Database TriggerOracle Database Trigger
Oracle Database Trigger
 
Data types in c++
Data types in c++ Data types in c++
Data types in c++
 
Views
ViewsViews
Views
 
Aggregate function
Aggregate functionAggregate function
Aggregate function
 
SQL Server Stored procedures
SQL Server Stored proceduresSQL Server Stored procedures
SQL Server Stored procedures
 
2.software requirement specification
2.software requirement specification2.software requirement specification
2.software requirement specification
 
System programming
System programmingSystem programming
System programming
 
Introduction to Repetition Structures
Introduction to Repetition StructuresIntroduction to Repetition Structures
Introduction to Repetition Structures
 
file handling c++
file handling c++file handling c++
file handling c++
 
System Programming Unit III
System Programming Unit IIISystem Programming Unit III
System Programming Unit III
 

Similar to Program Design

C++ advanced PPT.pdf
C++ advanced PPT.pdfC++ advanced PPT.pdf
C++ advanced PPT.pdf
DinashMaliya3
 
Cs1123 2 comp_prog
Cs1123 2 comp_progCs1123 2 comp_prog
Cs1123 2 comp_progTAlha MAlik
 
Operating Systems - Processor Management
Operating Systems - Processor ManagementOperating Systems - Processor Management
Operating Systems - Processor Management
Damian T. Gordon
 
VLSI Introduction to PSPICE
VLSI Introduction to PSPICEVLSI Introduction to PSPICE
VLSI Introduction to PSPICE
Abhishekvb
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
noahjamessss
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
cskvsmi44
 
02.softwareengr.ppt
02.softwareengr.ppt02.softwareengr.ppt
02.softwareengr.ppt
hesam ahmadian
 
C++ programming program design including data structures
C++ programming program design including data structures C++ programming program design including data structures
C++ programming program design including data structures
Ahmad Idrees
 
Operating Systems: Processor Management
Operating Systems: Processor ManagementOperating Systems: Processor Management
Operating Systems: Processor Management
Damian T. Gordon
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptx
TadiwaMawere
 
Algorithm.pdf
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
MIT,Imphal
 
1_Basic Structure of Computers.pptx
1_Basic Structure of Computers.pptx1_Basic Structure of Computers.pptx
1_Basic Structure of Computers.pptx
KarthikChavan5
 
Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6ashhadiqbal
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
helpido6
 
3 modularisation and bdc
3 modularisation and bdc3 modularisation and bdc
3 modularisation and bdc
Siva Kumar
 
Chap6 procedures &amp; macros
Chap6 procedures &amp; macrosChap6 procedures &amp; macros
Chap6 procedures &amp; macros
HarshitParkar6677
 
Java developer trainee implementation and import
Java developer trainee implementation and importJava developer trainee implementation and import
Java developer trainee implementation and import
iamluqman0403
 
Lecture1
Lecture1Lecture1
Lecture1
Andrew Raj
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
AnasYunusa
 

Similar to Program Design (20)

C++ advanced PPT.pdf
C++ advanced PPT.pdfC++ advanced PPT.pdf
C++ advanced PPT.pdf
 
Cs1123 2 comp_prog
Cs1123 2 comp_progCs1123 2 comp_prog
Cs1123 2 comp_prog
 
Operating Systems - Processor Management
Operating Systems - Processor ManagementOperating Systems - Processor Management
Operating Systems - Processor Management
 
VLSI Introduction to PSPICE
VLSI Introduction to PSPICEVLSI Introduction to PSPICE
VLSI Introduction to PSPICE
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
02.softwareengr.ppt
02.softwareengr.ppt02.softwareengr.ppt
02.softwareengr.ppt
 
C++ programming program design including data structures
C++ programming program design including data structures C++ programming program design including data structures
C++ programming program design including data structures
 
Operating Systems: Processor Management
Operating Systems: Processor ManagementOperating Systems: Processor Management
Operating Systems: Processor Management
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptx
 
Algorithm.pdf
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
 
1_Basic Structure of Computers.pptx
1_Basic Structure of Computers.pptx1_Basic Structure of Computers.pptx
1_Basic Structure of Computers.pptx
 
Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
 
3 modularisation and bdc
3 modularisation and bdc3 modularisation and bdc
3 modularisation and bdc
 
Chap6 procedures &amp; macros
Chap6 procedures &amp; macrosChap6 procedures &amp; macros
Chap6 procedures &amp; macros
 
Cs 1114 - lecture-2
Cs 1114 - lecture-2Cs 1114 - lecture-2
Cs 1114 - lecture-2
 
Java developer trainee implementation and import
Java developer trainee implementation and importJava developer trainee implementation and import
Java developer trainee implementation and import
 
Lecture1
Lecture1Lecture1
Lecture1
 
COM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptxCOM 211 PRESENTATION.pptx
COM 211 PRESENTATION.pptx
 

More from Forrester High School

Database Evaluation
Database EvaluationDatabase Evaluation
Database Evaluation
Forrester High School
 
Testing SQL
Testing SQLTesting SQL
SQL
SQLSQL
Database Query Design
Database Query DesignDatabase Query Design
Database Query Design
Forrester High School
 
Data Dictionary
Data DictionaryData Dictionary
Data Dictionary
Forrester High School
 
Compound Keys
Compound KeysCompound Keys
Compound Keys
Forrester High School
 
Entity Occurrence Diagrams
Entity Occurrence DiagramsEntity Occurrence Diagrams
Entity Occurrence Diagrams
Forrester High School
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
Forrester High School
 
Database Analysis
Database AnalysisDatabase Analysis
Database Analysis
Forrester High School
 
Software Evaluation
Software EvaluationSoftware Evaluation
Software Evaluation
Forrester High School
 
Software Testing
Software TestingSoftware Testing
Software Testing
Forrester High School
 
Python Predefined Functions
Python Predefined FunctionsPython Predefined Functions
Python Predefined Functions
Forrester High School
 
Python Substrings
Python SubstringsPython Substrings
Python Substrings
Forrester High School
 
Variable Scope
Variable ScopeVariable Scope
Variable Scope
Forrester High School
 
Records in Python
Records in PythonRecords in Python
Records in Python
Forrester High School
 
Parallel arrays in python
Parallel arrays in pythonParallel arrays in python
Parallel arrays in python
Forrester High School
 
SDD Predefined Functions
SDD Predefined FunctionsSDD Predefined Functions
SDD Predefined Functions
Forrester High School
 
SDD Cconditional Loops
SDD Cconditional LoopsSDD Cconditional Loops
SDD Cconditional Loops
Forrester High School
 
SDD Fixed Loops
SDD Fixed LoopsSDD Fixed Loops
SDD Fixed Loops
Forrester High School
 
SDD Conditional Statements
SDD Conditional StatementsSDD Conditional Statements
SDD Conditional Statements
Forrester High School
 

More from Forrester High School (20)

Database Evaluation
Database EvaluationDatabase Evaluation
Database Evaluation
 
Testing SQL
Testing SQLTesting SQL
Testing SQL
 
SQL
SQLSQL
SQL
 
Database Query Design
Database Query DesignDatabase Query Design
Database Query Design
 
Data Dictionary
Data DictionaryData Dictionary
Data Dictionary
 
Compound Keys
Compound KeysCompound Keys
Compound Keys
 
Entity Occurrence Diagrams
Entity Occurrence DiagramsEntity Occurrence Diagrams
Entity Occurrence Diagrams
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
Database Analysis
Database AnalysisDatabase Analysis
Database Analysis
 
Software Evaluation
Software EvaluationSoftware Evaluation
Software Evaluation
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Python Predefined Functions
Python Predefined FunctionsPython Predefined Functions
Python Predefined Functions
 
Python Substrings
Python SubstringsPython Substrings
Python Substrings
 
Variable Scope
Variable ScopeVariable Scope
Variable Scope
 
Records in Python
Records in PythonRecords in Python
Records in Python
 
Parallel arrays in python
Parallel arrays in pythonParallel arrays in python
Parallel arrays in python
 
SDD Predefined Functions
SDD Predefined FunctionsSDD Predefined Functions
SDD Predefined Functions
 
SDD Cconditional Loops
SDD Cconditional LoopsSDD Cconditional Loops
SDD Cconditional Loops
 
SDD Fixed Loops
SDD Fixed LoopsSDD Fixed Loops
SDD Fixed Loops
 
SDD Conditional Statements
SDD Conditional StatementsSDD Conditional Statements
SDD Conditional Statements
 

Recently uploaded

How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 

Recently uploaded (20)

How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 

Program Design

  • 2. DESIGN • The modular design of a software solution can be carried out in three stages: • Top level design • the main steps that the program will carry out • each of the main steps will become a sub-program • Data flow • shows the data that flows IN and OUT of each sub-program • data IN – will be passed as a parameter from the main program into the sub- program • data OUT – will be returned from the sub-program back to the main program • Refinements • a break down of each of the main steps from the top level design
  • 3. DESIGN EXAMPLE 1 Design a program that displays the leading driver in the Formula 1 championship. The program should: • read the driver name and their number of points from a file • work out the driver with the most points • display the leading driver, and their number of points
  • 4. TOP LEVEL DESIGN (STRUCTURE DIAGRAM) Leading driver Read drivers and points from file Work out driver with most points Display leading driver and their points
  • 5. DATA FLOW (STRUCTURE DIAGRAM) Leading driver Read drivers and points from file Work out driver with most points Display leading driver and their points driver array points array points array position position driver array
  • 6. REFINEMENTS (STRUCTURE DIAGRAM) Leading driver Read drivers and points from file Work out driver with most points Display leading driver and their points Open drivers file Loop for drivers Read name into array Read points into array Close drivers file Set max to points[0] Loop for remaining drivers Display driver[position] Display points[position ] points > max? set max to points store position
  • 7. DESIGN EXAMPLE 2 Design a program that asks the user to enter the temperature for 7 days, and then calculates the highest and lowest temperatures.
  • 8. TOP LEVEL DESIGN (PSEUDOCODE) 1. Get daily temperatures 2. Calculate highest temperature 3. Calculate lowest temperature 4. Display highest and lowest temperatures
  • 9. DATA FLOW (PSEUDOCODE) 1. Get daily temperatures • OUT: array of temperatures 2. Calculate highest temperature • IN: array of temperatures • OUT: highest temperature 3. Calculate lowest temperature • IN: array of temperatures • OUT: lowest temperature 4. Display highest and lowest temperatures • IN: highest temperature, lowest temperature
  • 10. REFINEMENTS (PSEUDOCODE) 1. Get daily temperatures 1.1 LOOP 7 TIMES 1.2 GET daily temperature FROM KEYBOARD 1.3 STORE daily temperature IN temperatures_array
  • 11. REFINEMENTS (PSEUDOCODE) 2. Calculate highest temperature 1.1 SET highest_temp TO 1st element in temperatures_array 1.2 LOOP WITH counter FROM 2nd array element TO 7th array element 1.3 IF temperatures_array[counter] > highest_temp THEN 1.4 SET highest_temp TO temperatures_array[counter] 1.5 END IF 1.6 END LOOP
  • 12. REFINEMENTS (PSEUDOCODE) 3. Calculate lowest temperature 1.1 SET lowest_temp TO 1st element in temperatures_array 1.2 LOOP WITH counter FROM 2nd array element TO 7th array element 1.3 IF temperatures_array[counter] < lowest_temp THEN 1.4 SET lowest_temp TO temperatures_array[counter] 1.5 END IF 1.6 END LOOP
  • 13. REFINEMENTS (PSEUDOCODE) 4. Display highest and lowest temperatures 1.1 DISPLAY highest_temp 1.2 DISPLAY lowest_temp