WorksheetsAlgorithm Dvpmt:Pseudocode, Types of Statements
Total questions: 27
Worksheet time: 16mins
In the problem solving steps, what is the next step that comes after:
1. define the problem---->2. Propose and evalute solutions------> 3. select the most efficient solution-----> 4._________?
1st.-- Develop
2nd--- Represent the solution as an algorithm (Pseudocode or Flowchart)
Two ways an algorithm can be represented are?
Flowcharts
Codes and diagrams
Pseudocode
What is an algorithm?
A set of instructions for solving a problem in an infinite number of times
A set of instructions for solving a problem in a finite number of times
An (a) is a set of instructions for solving a problem in a finite amount of times.
Pseudocode is to statements as flowcharts is to diagrams that uses _______ and _______?
flowlines
symbols
What is a pseudocode?
A set of statements in the form of English-like code that mimicks a real programming language
What is a flowchart?
A flowchart is a diagram that uses symbols and flowlines to outline the steps in solving an algorithm
A flowchart is a set of statements used to solve an algorithm
In algorith development, what is a statement?
A statement is a single line of instruction
In algorithm development, what are 4 types of ststements?
Input
Output
Assignment
Unconditional
conditional
In algorithm development, what are the function of input statements?
allow the computer to receive data from users in variables for processing
Keywords to use in input statements are: (use capital letters)______ and ____
(a)
In algorithm development, what is the structure of Input Statements?
Keyword VariableName
What are 2 examples of input statements?
Read Name
Accept num1
A=B
PRINT "Thomas"
State a suitable input statement(s) for:
"Accept two numbers from the user"
Accept num1, num2
What is the purpose of assignment statements?
Allow the computer to assign a value to a variable in memory
In assignment statements, the variable being assigned must be to the _______ of the equal sign.
What is the purpose of output statements?
to prevent a buildup of information
allow the computer to display information to the user on the screen
Three keywords to use for output statements are:
WRITE
DISPLAY
ACCEPT
Output statements are used to display 3 things to the user: ______, ______ and______
Message/Instruction
Value of a variable
Pictures/diagrams
Label for a variable
The prompt statement is an________ statement,
Input
Output
Assignment
guess
What is a prompt statement?
A prompt statement is an output statement used to give instruction to the user.
Keyword for a prompt statement?
Accept
Instruction/string
Read
PRINT"Please enter a number":
is an example of which type of starement"
promt statement
assignment statement
The _____ statement may be used to display data that is in the computer's _________.
output, memory
The output statement may be used to display data that is in a computer's memory. The data stored in memory is stored using a _______ ________?
variable name
How should you structure an output statement?
Keyword variableName
variableName Keyword
none of these
It is sometimes necessary to output a label for a variable in order to indentify the value of the variable being printed. What structure should you use for labels/tags?
Keyword"label/string", variableName
Keyword variableName
Keyword"instruction/string"
