Post on 14-Feb-2016
description
transcript
CS0004: Introduction to Programming
Problem Solving and Programming Tools
Review Machine Language
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Higher-Level Languages
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Higher-Level Languages consists of instruction that people can understand.
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Higher-Level Languages consists of instruction that people can understand.
Event-driven programming
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Higher-Level Languages consists of instruction that people can understand.
Event-driven programming is a paradigm in which the flow of programs are determined by events.
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Higher-Level Languages consists of instruction that people can understand.
Event-driven programming is a paradigm in which the flow of programs are determined by events.
A program
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Higher-Level Languages consists of instruction that people can understand.
Event-driven programming is a paradigm in which the flow of programs are determined by events.
A program is a collection of instructions.
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Higher-Level Languages consists of instruction that people can understand.
Event-driven programming is a paradigm in which the flow of programs are determined by events.
A program is a collection of instructions. A compiler
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Higher-Level Languages consists of instruction that people can understand.
Event-driven programming is a paradigm in which the flow of programs are determined by events.
A program is a collection of instructions. A compiler is a computer program that
translates high-level language such as VB in Machine Language.
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Higher-Level Languages consists of instruction that people can understand.
Event-driven programming is a paradigm in which the flow of programs are determined by events.
A program is a collection of instructions. A compiler is a computer program that
translates high-level language such as VB in Machine Language.
Running a program
Review Machine Language is a system of instructions
and data executed directly by a computer's central processing unit.
Higher-Level Languages consists of instruction that people can understand.
Event-driven programming is a paradigm in which the flow of programs are determined by events.
A program is a collection of instructions. A compiler is a computer program that
translates high-level language such as VB in Machine Language.
Running a program is executing the instructions given a program.
Programming Languages and Problem Solving In this class we will be using Visual Basic, but
there are many things it shares with most programming languages.
Programming Languages and Problem Solving In this class we will be using Visual Basic, but
there are many things it shares with most programming languages.
Namely, 3 things:
Programming Languages and Problem Solving In this class we will be using Visual Basic, but
there are many things it shares with most programming languages.
Namely, 3 things: Takes in data
Programming Languages and Problem Solving In this class we will be using Visual Basic, but
there are many things it shares with most programming languages.
Namely, 3 things: Takes in data Manipulates the data
Programming Languages and Problem Solving In this class we will be using Visual Basic, but
there are many things it shares with most programming languages.
Namely, 3 things: Takes in data Manipulates the data Produces some information
Programming Languages and Problem Solving In this class we will be using Visual Basic, but
there are many things it shares with most programming languages.
Namely, 3 things: Takes in data Manipulates the data Produces some information
If you can break a problem down into these steps, you can create a program to solve it.
Programming Languages and Problem Solving In this class we will be using Visual Basic, but
there are many things it shares with most programming languages.
Namely, 3 things: Takes in data Manipulates the data Produces some information
If you can break a problem down into these steps, you can create a program to solve it.
But do we start writing code as soon as we run into a problem?
Programming Languages and Problem Solving In this class we will be using Visual Basic, but
there are many things it shares with most programming languages.
Namely, 3 things: Takes in data Manipulates the data Produces some information
If you can break a problem down into these steps, you can create a program to solve it.
But do we start writing code as soon as we run into a problem?
Answer: No.
Algorithms vs. Programs An Algorithm is
Algorithms vs. Programs An Algorithm is a step-by-step procedure
devised for the purpose of taking in data and producing the correct output.
Algorithms vs. Programs An Algorithm is a step-by-step procedure
devised for the purpose of taking in data and producing the correct output.
A program is the actual implementation of an algorithm in a programming language.
Algorithms vs. Programs An Algorithm is a step-by-step procedure
devised for the purpose of taking in data and producing the correct output.
A program is the actual implementation of an algorithm in a programming language.
Before writing a program, you must develop an algorithm to solve a problem.
Algorithms vs. Programs An Algorithm is a step-by-step procedure
devised for the purpose of taking in data and producing the correct output.
A program is the actual implementation of an algorithm in a programming language.
Before writing a program, you must develop an algorithm to solve a problem.
Very Important: It is highly recommended to think about the problem first, then develop an algorithm, then write the program.
Program Development Cycle When Developing a program in both the real
world AND in this class, there are 6 steps:
Program Development Cycle When Developing a program in both the real
world AND in this class, there are 6 steps:1) Analyze the problem
Program Development Cycle When Developing a program in both the real
world AND in this class, there are 6 steps:1) Analyze the problem2) Plan a solution
Program Development Cycle When Developing a program in both the real
world AND in this class, there are 6 steps:1) Analyze the problem2) Plan a solution3) Design an interface
Program Development Cycle When Developing a program in both the real
world AND in this class, there are 6 steps:1) Analyze the problem2) Plan a solution3) Design an interface4) Write the code
Program Development Cycle When Developing a program in both the real
world AND in this class, there are 6 steps:1) Analyze the problem2) Plan a solution3) Design an interface4) Write the code5) Test and debug
Program Development Cycle When Developing a program in both the real
world AND in this class, there are 6 steps:1) Analyze the problem2) Plan a solution3) Design an interface4) Write the code5) Test and debug6) Document the program
Program Development Cycle When Developing a program in both the real
world AND in this class, there are 6 steps1) Analyze the problem2) Plan a solution3) Design an interface4) Write the code5) Test and debug6) Document the program7) (Not done in this class) Maintain the program
Program Development Cycle When Developing a program in both the real
world AND in this class, there are 6 steps1) Analyze the problem2) Plan a solution3) Design an interface4) Write the code5) Test and debug6) Document the program7) (Not done in this class) Maintain the program To be successful in this class, you must
perform each of these steps.
Analyze the Problem Understand what the problem is and what the
solution should be
Analyze the Problem Understand what the problem is and what the
solution should be Keep in mind what the End User should be
able to see and do.
Analyze the Problem Understand what the problem is and what the
solution should be Keep in mind what the End User should be
able to see and do. User –
Analyze the Problem Understand what the problem is and what the
solution should be Keep in mind what the End User should be
able to see and do. User – Anyone who uses the program.
Analyze the Problem Understand what the problem is and what the
solution should be Keep in mind what the End User should be
able to see and do. User – Anyone who uses the program.
End User –
Analyze the Problem Understand what the problem is and what the
solution should be Keep in mind what the End User should be
able to see and do. User – Anyone who uses the program.
End User – The person whom the program was designed for him/her to use.
Analyze the Problem Understand what the problem is and what the
solution should be Keep in mind what the End User should be
able to see and do. User – Anyone who uses the program.
End User – The person whom the program was designed for him/her to use.
Also keep in mind what the CORRECT solution to the problem is.
Analyze the Problem Understand what the problem is and what the
solution should be Keep in mind what the End User should be
able to see and do. User – Anyone who uses the program.
End User – The person whom the program was designed for him/her to use.
Also keep in mind what the CORRECT solution to the problem is.
This needs to be done before ANY of the following steps can take place.
Analyze the Problem Understand what the problem is and what the
solution should be Keep in mind what the End User should be able to
see and do. User – Anyone who uses the program.
End User – The person whom the program was designed for him/her to use.
Also keep in mind what the CORRECT solution to the problem is.
This needs to be done before ANY of the following steps can take place.
People have this job in real life: http://en.wikipedia.org/wiki/Software_analyst
Analyze the Problem Understand what the problem is and what the
solution should be Keep in mind what the End User should be able to
see and do. User – Anyone who uses the program.
End User – The person whom the program was designed for him/her to use.
Also keep in mind what the CORRECT solution to the problem is.
This needs to be done before ANY of the following steps can take place.
People have this job in real life: http://en.wikipedia.org/wiki/Software_analyst
Plan a Solution Once you understand the problem, you can
develop an algorithm.
Plan a Solution Once you understand the problem, you can
develop an algorithm. Create precise steps for the entire flow of the
program. Usually in the form of:
Plan a Solution Once you understand the problem, you can
develop an algorithm. Create precise steps for the entire flow of the
program. Usually in the form of: Get Input
Plan a Solution Once you understand the problem, you can
develop an algorithm. Create precise steps for the entire flow of the
program. Usually in the form of: Get Input Validate Input
Plan a Solution Once you understand the problem, you can
develop an algorithm. Create precise steps for the entire flow of the
program. Usually in the form of: Get Input Validate Input Manipulate Input
Plan a Solution Once you understand the problem, you can
develop an algorithm. Create precise steps for the entire flow of the
program. Usually in the form of: Get Input Validate Input Manipulate Input Output Solution
Plan a Solution Once you understand the problem, you can
develop an algorithm. Create precise steps for the entire flow of the
program. Usually in the form of: Get Input Validate Input Manipulate Input Output Solution
Every detail should be covered in the algorithm.
Plan a Solution Once you understand the problem, you can
develop an algorithm. Create precise steps for the entire flow of the
program. Usually in the form of: Get Input Validate Input Manipulate Input Output Solution
Every detail should be covered in the algorithm. Consider what is logical and illogical for the
control flow.
Plan a Solution Once you understand the problem, you can develop
an algorithm. Create precise steps for the entire flow of the
program. Usually in the form of: Get Input Validate Input Manipulate Input Output Solution
Every detail should be covered in the algorithm. Consider what is logical and illogical for the control
flow. Think about what situations can happen in the
problem.
Plan a Solution Once you understand the problem, you can develop an
algorithm. Create precise steps for the entire flow of the program.
Usually in the form of: Get Input Validate Input Manipulate Input Output Solution
Every detail should be covered in the algorithm. Consider what is logical and illogical for the control flow. Think about what situations can happen in the problem. There are many tools programmers use to model the
flow of a program.
Plan a Solution Once you understand the problem, you can develop an
algorithm. Create precise steps for the entire flow of the program.
Usually in the form of: Get Input Validate Input Process Input Output Solution
Every detail should be covered in the algorithm. Consider what is logical and illogical for the control flow. Think about what situations can happen in the problem. There are many tools programmers use to model the flow of a
program. In real-world software projects, this is often done by committee
Design the Interface An interface is how two component interact
with each other.
Design the Interface An interface is how two component interact
with each other. User Interface – How the user interact with your
program.
Design the Interface An interface is how two component interact
with each other. User Interface – How the user interact with your
program. Think about how you allow the end user to
interact with you program.
Design the Interface An interface is how two component interact
with each other. User Interface – How the user interact with your
program. Think about how you allow the end user to
interact with you program. Consider how the user inputs data and views
results.
Design the Interface An interface is how two component interact
with each other. User Interface – How the user interact with your
program. Think about how you allow the end user to
interact with you program. Consider how the user inputs data and views
results. Think about what makes sense to the end
user.
Design the Interface An interface is how two component interact
with each other. User Interface – How the user interact with your
program. Think about how you allow the end user to
interact with you program. Consider how the user inputs data and views
results. Think about what makes sense to the end
user. Visual Basic is good for this.
Design the Interface An interface is how two component interact
with each other. User Interface – How the user interact with your
program. Think about how you allow the end user to
interact with you program. Consider how the user inputs data and views
results. Think about what makes sense to the end
user. Visual Basic is good for this. For this course, this includes windows,
buttons, text boxes, etc.
Design the Interface An interface is how two component interact with each
other. User Interface – How the user interact with your program.
Think about how you allow the end user to interact with you program.
Consider how the user inputs data and views results. Think about what makes sense to the end user. Visual Basic is good for this. For this course, this includes windows, buttons, text
boxes, etc. Again, this is a job in real life: http://
en.wikipedia.org/wiki/User_interface_design
Write the Code Writing code is a process of translating the
algorithm you developed into a programming language.
Write the Code Writing code is a process of translating the
algorithm you developed into a programming language.
Coding – technical word for writing code.
Write the Code Writing code is a process of translating the
algorithm you developed into a programming language.
Coding – technical word for writing code. This is where knowledge of a programming
language (VB in our case) is used.
Write the Code Writing code is a process of translating the
algorithm you developed into a programming language.
Coding – technical word for writing code. This is where knowledge of a programming
language (VB in our case) is used. Again, this is a real-world job: http://
en.wikipedia.org/wiki/Software_developer http://en.wikipedia.org/wiki/Software_engineer
Testing and Debugging Bug -
Testing and Debugging Bug - an error, flaw, mistake, failure, or fault in
a computer program Even experienced software engineers make
mistakes, so it is important to test your program for errors.
Testing and Debugging Bug - an error, flaw, mistake, failure, or fault in
a computer program Even experienced software engineers make
mistakes, so it is important to test your program for errors.
Two Kinds (of many) of Errors:
Testing and Debugging Bug - an error, flaw, mistake, failure, or fault in
a computer program Even experienced software engineers make
mistakes, so it is important to test your program for errors.
Two Kinds (of many) of Errors: Syntax Error – Error in typing the program.
Testing and Debugging Bug - an error, flaw, mistake, failure, or fault in
a computer program Even experienced software engineers make
mistakes, so it is important to test your program for errors.
Two Kinds (of many) of Errors: Syntax Error – Error in typing the program. Logical Error – Inconsistency between what you
want the program to do and what it actually does.
Testing and Debugging Bug - an error, flaw, mistake, failure, or fault in
a computer program Even experienced software engineers make
mistakes, so it is important to test your program for errors.
Two Kinds (of many) of Errors: Syntax Error – Error in typing the program. Logical Error – Inconsistency between what you
want the program to do and what it actually does. It’s important to consider all normal and
abnormal inputs for the program.
Testing and Debugging Bug - an error, flaw, mistake, failure, or fault in a
computer program Even experienced software engineers make
mistakes, so it is important to test your program for errors.
Two Kinds (of many) of Errors: Syntax Error – Error in typing the program. Logical Error – Inconsistency between what you want the
program to do and what it actually does. It’s important to consider all normal and abnormal
inputs for the program. Actual Job: http://
en.wikipedia.org/wiki/Software_tester
Complete the Documentation Documentation – Organizing all the material
that describes the program.
Complete the Documentation Documentation – Organizing all the material
that describes the program. Documentation includes:
Complete the Documentation Documentation – Organizing all the material
that describes the program. Documentation includes:
Comments inside of the code document that describes to whoever reads it what specific sections do.
Complete the Documentation Documentation – Organizing all the material
that describes the program. Documentation includes:
Comments inside of the code document that describes to whoever reads it what specific sections do.
Comments inside of the code that describe the who the author is, when it was written, and any other relevant information
Complete the Documentation Documentation – Organizing all the material
that describes the program. Documentation includes:
Comments inside of the code document that describes to whoever reads it what specific sections do.
Comments inside of the code that describe the who the author is, when it was written, and any other relevant information
In commercial settings (industry) this includes user manuals that describe how to use the program.
Complete the Documentation Documentation – Organizing all the material that
describes the program. Documentation includes:
Comments inside of the code document that describes to whoever reads it what specific sections do.
Comments inside of the code that describe the who the author is, when it was written, and any other relevant information
In commercial settings (industry) this includes user manuals that describe how to use the program.
This may seem annoying, but it is a very important requirement for this course.
Complete the Documentation Documentation – Organizing all the material that
describes the program. Documentation includes:
Comments inside of the code document that describes to whoever reads it what specific sections do.
Comments inside of the code that describe the who the author is, when it was written, and any other relevant information
In commercial settings (industry) this includes user manuals that describe how to use the program.
This may seem annoying, but it is a very important requirement for this course.
It is easiest to document code WHILE writing it, as well as completing it once finished writing code.
Modeling Tools To help understand the steps of an algorithm,
programmers use a variety of tools.
Modeling Tools To help understand the steps of an algorithm,
programmers use a variety of tools to model the algorithm.
Three that will help us in this class are:
Modeling Tools To help understand the steps of an algorithm,
programmers use a variety of tools Three that will help us in this class are:
Flowcharts – Graphically depict the logical steps to carry out a task and show how the steps relate to each other
Modeling Tools To help understand the steps of an algorithm,
programmers use a variety of tools Three that will help us in this class are:
Flowcharts – Graphically depict the logical steps to carry out a task and show how the steps relate to each other
Pseudocode – English-like phrases with some Visual Basic terms to outline the task
Modeling Tools To help understand the steps of an algorithm,
programmers use a variety of tools Three that will help us in this class are:
Flowcharts – Graphically depict the logical steps to carry out a task and show how the steps relate to each other
Pseudocode – English-like phrases with some Visual Basic terms to outline the task
Hierarchy Charts – Show how the different parts of a program relate to each other.
Developing an Algorithm Consider the problem of finding out how many
stamps you need to put on an envelope to mail it.
Developing an Algorithm Consider the problem of finding out how many
stamps you need to put on an envelope to mail it.
The rule here is that you need 1 stamp for every 5 sheets of paper in the envelope.
Developing an Algorithm Consider the problem of finding out how many
stamps you need to put on an envelope to mail it.
The rule here is that you need 1 stamp for every 5 sheets of paper in the envelope.
So the algorithm looks something like this:
Developing an Algorithm Consider the problem of finding out how many
stamps you need to put on an envelope to mail it.
The rule here is that you need 1 stamp for every 5 sheets of paper in the envelope.
So the algorithm looks something like this:1. Get the number of sheets from the user.
Developing an Algorithm Consider the problem of finding out how many
stamps you need to put on an envelope to mail it.
The rule here is that you need 1 stamp for every 5 sheets of paper in the envelope.
So the algorithm looks something like this:1. Get the number of sheets from the user.2. Divide the number of sheets by 5
Developing an Algorithm Consider the problem of finding out how many
stamps you need to put on an envelope to mail it.
The rule here is that you need 1 stamp for every 5 sheets of paper in the envelope.
So the algorithm looks something like this:1. Get the number of sheets from the user.2. Divide the number of sheets by 53. Round the result from step 2 the highest
whole number
Developing an Algorithm Consider the problem of finding out how many
stamps you need to put on an envelope to mail it.
The rule here is that you need 1 stamp for every 5 sheets of paper in the envelope.
So the algorithm looks something like this:1. Get the number of sheets from the user.2. Divide the number of sheets by 53. Round the result from step 2 the highest
whole number4. Output the number of stamps
Developing an Algorithm Consider the problem of finding out how many
stamps you need to put on an envelope to mail it. The rule here is that you need 1 stamp for every 5
sheets of paper in the envelope. So the algorithm looks something like this:1. Get the number of sheets from the user.2. Divide the number of sheets by 53. Round the result from step 2 the highest whole
number4. Output the number of stamps Let’s see how the three modeling tools work here
Developing an Algorithm Consider the problem of finding out how many
stamps you need to put on an envelope to mail it. The rule here is that you need 1 stamp for every 5
sheets of paper in the envelope. So the algorithm looks something like this:1. Get the number of sheets from the user.2. Divide the number of sheets by 53. Round the result from step 2 the highest whole
number4. Output the number of stamps Let’s see how the three modeling tools work here
Developing an Algorithm Consider the problem of finding out how many
stamps you need to put on an envelope to mail it. The rule here is that you need 1 stamp for every 5
sheets of paper in the envelope. So the algorithm looks something like this:1. Get the number of sheets from the user. (Input)2. Divide the number of sheets by 5 (Process)3. Round the result from step 2 the highest whole
number (Process)4. Output the number of stamps (Output) Let’s see how the three modeling tools work here
Developing an Algorithm So a specific example looks like
Developing an Algorithm So a specific example looks like 1. The user inputs 16 sheets of paper
Developing an Algorithm So a specific example looks like 1. The user inputs 16 sheets of paper2. Dividing 16 by 5 results in 3.2
Developing an Algorithm So a specific example looks like 1. The user inputs 16 sheets of paper2. Dividing 16 by 5 results in 3.23. Rounding 3.2 up results in 4
Developing an Algorithm So a specific example looks like 1. The user inputs 16 sheets of paper2. Dividing 16 by 5 results in 3.23. Rounding 3.2 up results in 44. Output 4 stamps
Developing an Algorithm So a specific example looks like 1. The user inputs 16 sheets of paper2. Dividing 16 by 5 results in 3.23. Rounding 3.2 up results in 44. Output 4 stamps Simple enough, right? What could go
wrong?
Developing an Algorithm So a specific example looks like 1. The user inputs 16 sheets of paper2. Dividing 16 by 5 results in 3.23. Rounding 3.2 up results in 44. Output 4 stamps Simple enough, right? What could go
wrong? What if the user inputs “Banana” sheets of
paper?
Developing an Algorithm Revised Algorithm:1. Get the number of sheets from the user.
(Input)
Developing an Algorithm Revised Algorithm:1. Get the number of sheets from the user.
(Input)2. Check to see if the input is a positive
number. (Validate)
Developing an Algorithm Revised Algorithm:1. Get the number of sheets from the user.
(Input)2. Check to see if the input is a positive
number. (Validate)3. Divide the number of sheets by 5 (Process)4. Round the result from step 2 the highest
whole number (Process)5. Output the number of stamps (Output) Now that our algorithm is set, lets see how
the modeling tools work.
Developing an Algorithm Revised Algorithm:1. Get the number of sheets from the user.
(Input)2. Check to see if the input is a positive
number. (Validate)3. Divide the number of sheets by 5 (Process)
Developing an Algorithm Revised Algorithm:1. Get the number of sheets from the user.
(Input)2. Check to see if the input is a positive
number. (Validate)3. Divide the number of sheets by 5 (Process)4. Round the result from step 2 the highest
whole number (Process)
Developing an Algorithm Revised Algorithm:1. Get the number of sheets from the user.
(Input)2. Check to see if the input is a positive
number. (Validate)3. Divide the number of sheets by 5 (Process)4. Round the result from step 2 the highest
whole number (Process)5. Output the number of stamps (Output)
Developing an Algorithm Revised Algorithm:1. Get the number of sheets from the user.
(Input)2. Check to see if the input is a positive
number. (Validate)3. Divide the number of sheets by 5 (Process)4. Round the result from step 2 the highest
whole number (Process)5. Output the number of stamps (Output) Now that our algorithm is set, lets see how
the modeling tools work.
Hierarchy ChartsPostage Stamp Program
Hierarchy ChartsPostage Stamp Program
Read Sheets Calculate Stamps Display Stamps
Hierarchy ChartsPostage Stamp Program
Read Sheets Calculate Stamps Display Stamps
Getsheets
Make suresheets is
a positive integer.
Hierarchy ChartsPostage Stamp Program
Read Sheets Calculate Stamps Display Stamps
Getsheets
Make suresheets is
a positive integer.
Must benumber
Must bepositive
Must be
integer
Hierarchy ChartsPostage Stamp Program
Read Sheets Calculate Stamps Display Stamps
Getsheets
Make suresheets is
a positive integer.
Set stamps =sheets / 5
Round stampsup to next whole
number
Must benumber
Must bepositive
Must be
integer
Hierarchy ChartsPostage Stamp Program
Read Sheets Calculate Stamps Display Stamps
Getsheets
Make suresheets is
a positive integer.
Display:"You will need: "
# of stampsSet stamps =sheets / 5
Round stampsup to next whole
number
Must benumber
Must bepositive
Must be
integer
Hierarchy Charts Good for showing the structure of the
algorithm
Hierarchy Charts Good for showing the structure of the
algorithm Good at breaking down the algorithm into
components
Hierarchy Charts Good for showing the structure of the
algorithm Good at breaking down the algorithm into
components Not too great at showing the order of events
Hierarchy Charts Good for showing the structure of the
algorithm Good at breaking down the algorithm into
components Not too great at showing the order of events Flow Charts are better at showing the order in
which the components execute.
Flow Charts Components
Flow Charts Components Flow Line - indicates the flow of logic
Flow Charts Components Flow Line - indicates the flow of logic
Terminal – indicates the start or end of a task
Flow Charts Components Flow Line - indicates the flow of logic
Terminal – indicates the start or end of a task
Input/Output – used for input or output operations. What is to be input or output should be in the figure.
Flow Charts Processing - used to show a processing step.
The instructions are displayed in the figure.
Flow Charts Processing - used to show a processing step.
The instructions are displayed in the figure.
Decision – used to show when a decision needs to be made. Lines for yes and no come out of it. The question is displayed in the figure.
Flow Charts Processing - used to show a processing step.
The instructions are displayed in the figure.
Decision – used to show when a decision needs to be made. Lines for yes and no come out of it. The question is displayed in the figure.
Connector – Used to join flow lines.
Flow ChartsStart
Flow ChartsStart
Read sheet
s
Flow ChartsStart
Read sheet
sIs sheets positiv
e numbe
r?
No
Yes
Flow ChartsStart
Set stamps = sheets / 5
Read sheet
sIs sheets positiv
e numbe
r?
No
Yes
Flow ChartsStart
Set stamps = sheets / 5
Read sheet
sIs sheets positiv
e numbe
r?
Round stamps up
to next whole
number
No
Yes
Flow ChartsStart
Set stamps = sheets / 5
Read sheet
sIs sheets positiv
e numbe
r?
Round stamps up
to next whole
numberDisplay: "You will need: " #stamps
No
Yes
Flow ChartsStart
Set stamps = sheets / 5
Read sheet
sIs sheets positiv
e numbe
r?
Round stamps up
to next whole
numberDisplay: "You will need: " #stamps
End
No
Yes
Flow ChartsStart
Set stamps = sheets / 5
Read sheet
sIs sheets positiv
e numbe
r?
Round stamps up
to next whole
numberDisplay: "You will need: " #stamps
End
Display error
message
No
Yes
Flow ChartsStart
Set stamps = sheets / 5
Read sheet
sIs sheets positiv
e numbe
r?
Round stamps up
to next whole
numberDisplay: "You will need: " #stamps
End
Display error
message
No
Yes
Pseudocode This will become more clear when you
understand VB terms better.
Pseudocode This will become more clear when you
understand VB terms better. Pseudocode is good for listing the steps of an
algorithm in a form that is easier to translate into VB.
Pseudocode This will become more clear when you
understand VB terms better. Pseudocode is good for listing the steps of an
algorithm in a form that is easier to translate into VB.
Important: There is NO SPECIFIC FORM to pseudocode, it can look as much like VB or English as you want. The more VB you learn, the more VB-like pseudocode you can write.
PseudocodeProgram: Determine the proper number of
steps for a letterRead sheetsif sheets is a positive integer
Stamps = Sheets/5Whole Stamps = Stamps rounded to next whole numberOutput Whole Stamps
elseDisplay Error