Podcast
Questions and Answers
Which of the following is the first step in designing a program?
Which of the following is the first step in designing a program?
- Input and Output Specification (correct)
- Program Testing and Debugging
- Algorithm and Data Structure Design
- Translation of Algorithm to a Programming Language
Algorithm design should occur after translation to a programming language to ensure compatibility.
Algorithm design should occur after translation to a programming language to ensure compatibility.
False (B)
What are the specifications in program designing?
What are the specifications in program designing?
Descriptions of the desired program input and output.
An algorithm is a finite sequence of ______ that can be performed in a finite length of time to solve a problem.
An algorithm is a finite sequence of ______ that can be performed in a finite length of time to solve a problem.
Match the following terms with their descriptions:
Match the following terms with their descriptions:
Which is the correct definition of Algorithm?
Which is the correct definition of Algorithm?
Data structure is the same as Data type?
Data structure is the same as Data type?
What is pseudo-language?
What is pseudo-language?
Designing Data Structure and Algorithm is expressed in ______ or pseudo language
Designing Data Structure and Algorithm is expressed in ______ or pseudo language
Match the items of the designing program:
Match the items of the designing program:
What can you say about Data structure and Algorithm?
What can you say about Data structure and Algorithm?
If you design your algorithms and data structure carefully you program needs a lot of debugging.
If you design your algorithms and data structure carefully you program needs a lot of debugging.
Define data structure in your own words.
Define data structure in your own words.
Outputs are data items resulting from the ______ of an algorithm.
Outputs are data items resulting from the ______ of an algorithm.
Match the criteria of Algorithm:
Match the criteria of Algorithm:
Which of the following is NOT necessarily a criteria of Algorithm?
Which of the following is NOT necessarily a criteria of Algorithm?
Finiteress is not an important criteria of an algorithm.
Finiteress is not an important criteria of an algorithm.
What is Definiteness in Algorithms?
What is Definiteness in Algorithms?
An algorithm may have ______ or more quantities that are externally supplied.
An algorithm may have ______ or more quantities that are externally supplied.
Match the step in getting the sum of positive N inputted integers:
Match the step in getting the sum of positive N inputted integers:
In the Algorithm on the text, about computing the sum of N inputted integers, what will happen if the Counter does not equal N?
In the Algorithm on the text, about computing the sum of N inputted integers, what will happen if the Counter does not equal N?
A computer can perform an instruction if it has insufficient information
A computer can perform an instruction if it has insufficient information
In an algorithm requirements what will happen if an instruction requires an division of an integer by 0
?
In an algorithm requirements what will happen if an instruction requires an division of an integer by 0
?
Outputs are ______ data items resulting from the execution of an algorithm
Outputs are ______ data items resulting from the execution of an algorithm
Match the phrase to its meaning in the context of algorithms:
Match the phrase to its meaning in the context of algorithms:
Why is it important for each step in an algorithm to have a unique successor instruction?
Why is it important for each step in an algorithm to have a unique successor instruction?
An algorithm with 'definiteness' may produce differing results with the same input data.
An algorithm with 'definiteness' may produce differing results with the same input data.
Provide a real-world example of an algorithm encountered daily.
Provide a real-world example of an algorithm encountered daily.
Data type refers to the kinds of ______ that a variable may hold in a given programming language
Data type refers to the kinds of ______ that a variable may hold in a given programming language
Match the examples to their corresponding data structures:
Match the examples to their corresponding data structures:
Which scenario exemplifies effectiveness criterion of an algorithm?
Which scenario exemplifies effectiveness criterion of an algorithm?
In algorithm design, translating to a programming language always precedes algorithm creation.
In algorithm design, translating to a programming language always precedes algorithm creation.
What is the purpose of debugging in program design?
What is the purpose of debugging in program design?
The design of a _______ depends on how we want to manipulate that data.
The design of a _______ depends on how we want to manipulate that data.
Match the terms with their definitions:
Match the terms with their definitions:
Which are acceptable inputs to a successful algorithm?
Which are acceptable inputs to a successful algorithm?
During coding, Debugging accounts for a large component of process regardless.
During coding, Debugging accounts for a large component of process regardless.
Give at least three situations from our everyday life we often encounter algorithm through directions.
Give at least three situations from our everyday life we often encounter algorithm through directions.
Translating algorithm to a certain programming language refers to programming and implementation if the data _______ and _____ meet the requirement of the language
Translating algorithm to a certain programming language refers to programming and implementation if the data _______ and _____ meet the requirement of the language
Match the types of actions an algorithm does in the correct order:
Match the types of actions an algorithm does in the correct order:
Flashcards
Program Designing
Program Designing
A creative process with specific steps and techniques for creating programs.
Input and Output Specification
Input and Output Specification
Knowing exactly what the program needs as input and the precise output it should produce.
Algorithm and Data Structure Design
Algorithm and Data Structure Design
Designing both the step-by-step process (algorithm) and how data is organized.
Translation to Programming Language
Translation to Programming Language
Converting the algorithm into a language the computer understands.
Signup and view all the flashcards
Program Testing and Debugging
Program Testing and Debugging
Finding and fixing errors to ensure the program works correctly.
Signup and view all the flashcards
Algorithm
Algorithm
A finite sequence of instructions to solve a specific problem in a finite amount of time.
Signup and view all the flashcards
Pseudo-Language
Pseudo-Language
A blend of informal English and programming constructs to represent algorithms.
Signup and view all the flashcards
Data Type
Data Type
Refers to the kind of data a variable can hold in a programming language.
Signup and view all the flashcards
Data Structure
Data Structure
A way of organizing data; a collection of variables connected in specific ways.
Signup and view all the flashcards
Definiteness
Definiteness
Ensures an algorithm produces the same results with the same input every time.
Signup and view all the flashcards
Finiteness
Finiteness
An algorithm must complete after a limited number of steps.
Signup and view all the flashcards
Effectiveness
Effectiveness
Each instruction must be able to be performed by a computer.
Signup and view all the flashcards
Input
Input
Information supplied to an algorithm.
Signup and view all the flashcards
Output
Output
Data items resulting from the execution of an algorithm.
Signup and view all the flashcardsStudy Notes
How to Design/Create Programs
- Designing a program is a creative process with specific steps and techniques.
- The program design process involves input and output specifications.
- It also entails algorithm and data structure design.
- It requires translation of the algorithm into a programming language.
- Testing and debugging the program makes up part of the design process as well.
Input and Output Specification
- Programmers need to know precisely the required input and output for a program.
- Specifications are accurate descriptions of the desired program input and output.
Algorithm and Data Structure Design
- Algorithm is a finite sequence of instructions to solve a problem within a finite time.
- Pseudo Language represents algorithms using a combination of informal English statements and programming language constructs.
- Data type refers to the kind of data a variable can hold in a programming language.
- A variable’s data type represents the set of values it can assume; for example, an integer variable can typically hold values from -32768 to 32767.
- Data structure is a way to organize data, referring to a collection of variables of possibly different data types connected in various ways.
- Data structure and algorithm are equally important and should be considered a unit.
- Algorithm design may depend on how data are stored, and data structure design depends on how we want to manipulate the data.
- Designing data structure and algorithm is expressed in pseudocode or pseudo-language.
Translation to Programming Language
- A program expressed in pseudocode or pseudo-language cannot be run on a computer.
- It must be translated into a programming language.
Program Testing and Debugging
- Program testing and debugging should not be the most time-consuming part of programming.
- Careful algorithm and data structure design can reduce the need for debugging.
- Even experienced programmers use testing techniques to discover and correct errors.
Algorithms
- Algorithm is a recipe for solving a problem.
- An algorithm is a finite set of instructions that accomplish a particular task if followed.
- Everyday encounters with algorithms include following directions or instructions for using products or recipes.
Criteria for Algorithms
- Every algorithm must meet these criteria: Input, Output, Definiteness, Finiteness, and Effectiveness.
Algorithm 1-1 Example
- The problem is to compute the sum of N inputted positive integers (N is a positive integer).
- First a positive number representing the number of integers to add is inputted (N).
- A COUNTER is set up to represent the number of integers read (COUNT).
- COUNT is initialized to 0.
- A variable named SUM is assigned and set to 0.
- If COUNT equals N, the value of SUM is displayed, and the process exits.
- Otherwise, COUNT is incremented by 1.
- A number A is inputted, its value is added to SUM, and the result is stored in SUM.
- Steps repeat from step 6.
Input
- An algorithm may have zero or more quantities that are externally supplied.
- Algorithm 1-1 accepts a minimum of zero input value.
Output
- Outputs are data items resulting from the execution of an algorithm, with at least one quantity processed.
- The output in Algorithm 1-1 is an integer representing the SUM of all numbers inputted by the user.
Definiteness
- The same inputs should yield the same results every time the algorithm is executed.
- There must be a unique initial instruction and successor for each instruction in an algorithm.
- Most instructions are performed from top to bottom unless specified otherwise, and all algorithms must follow a specific sequence of instructions.
- Algorithm 1-1 starts execution on step 1, then step 2, and so on, potentially leading to step 5 or exiting depending on the value of COUNT, with no ambiguous instruction.
Finiteness
- An algorithm will terminate after a finite number of steps.
- Based on Algorithm 1-1, since N is finite, the execution of the algorithm will be completed after a finite number of steps.
Effectiveness
- Effectiveness of an algorithm is measured by whether it performs what it is supposed to do.
- A computer cannot perform an instruction if it has insufficient information or if the result of the execution could be inherently undefined.
- For example, division by zero would render an instruction undefined.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.