Algorighims Flashcards
What does an output of 1 indicate for the following algorithm running on a five-element list of integers?
i = 0
x = 0
while i < 5
if list[i] < 0
x = 1
i = i + 1
Put x to output
All integers are positive.
All integers are negative.
At least one integer is negative.
At least one integer is positive.
At least one integer is negative.
When should a programmer develop an algorithm to solve a problem?
Before knowing the problem
Before writing a program to solve the problem
While writing a program to solve the problem
After writing a program to solve the problem
Before writing a program to solve the problem
What is the purpose of the following class diagram?
Shows how the Employee class is used in the program
Describes the execution flow of the Employee class’ operations
Specifies the Employee class’ behavioral requirements
Depicts the Employee class’ name, data members, and functions
Depicts the Employee class’ name, data members, and functions
Which elements are characteristic of a class diagram?
System’s classes, attributes, and methods and their features, constraints, and relationships
Flow of logic and process interaction within a system
Physical resources or logical architecture of a system
Internal structure of a class and collaboration between classes or instances
System’s classes, attributes, and methods and their features, constraints, and relationships
Review the following use case diagram:
What does a use case diagram do?
Diagrams a single use case
Connects several use cases to class diagrams
Provides an overview of several use cases
Lists use case goals
Provides an overview of several use cases