• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/58

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

58 Cards in this Set

  • Front
  • Back
Organized collection of data
Data Structures
The Phases of Software Development (do not have to be exact, order does not matter)
* Specification of the task
* Design of a solution
* Implementation (coding) of the solution
* Analysis of the solution
* Testing and debugging
* Maintenance and evolution of the system
* Obsolescence
Software development does not depend on any particular _____ ?
programing language
This person designed the C++ language
Bjarne Stroustrup
A technique that encourages important strategies of information hiding and component reuse
object-oriented programming (OOP)
What are the two benefits when you design your own data structures that is compliant with the Standard Library? ( 2 Answers)
* Other Programmers will understand your work more easily.

* Your own work will readily benefit from other pieces of the Standard Library
Define Specification
A precise description of the problem
What is the design phase?
Creating the steps to solve the problem
Implementation?
The actual C++ code that carries out of design.
What do you need for a good specification?
Needs to be precise, leaving no doubt about what the program must accomplish.
A set of instructions for solving a problem.
An Algorithm
This mixture of English and a programming language is called?
Pseudocode
The reason for pseudocode is to improve?
clarity
A good technique for designing an algorithm
Break down the problem into smaller and smaller subtasks until the code to write it becomes trivial.
What are the aspects of a good decomposition? (3 answers)
* The subtasks should help produce short pseudocode

* Code reuse

* Easily make maintenance updates
The functions that you write need to be ?
genuinely separated from one another.
Know only a much as you need, but not more
Information hiding
Specify your function's behavior by using what ?
preconditions and post conditions
True or False
When you are using a function you only need to think about what the function does, you don't need to think about how the function doe its work.
True
When we pretend that we do not know how a function is implemented we are using a form of ? called?
information hiding called procedural abstraction
A statement giving the condition that is required to be true when a function is called. The function is not guaranteed to perform as it should unless this is true.
A precondition
a statement describing what will be true when a function call is completed. if the function is correct and the precondition was true when the function was called, then the function will complete, and this will be true when the call is completed.
A postcondition
Stating the pre and post conditions should be the last step in designing any function.
False, it should be the first step
This consists of the function's return type, name, and parameter list, all following a semicolon.

Is there anything else that should be added ?
A prototype

Include the pre and post conditions
The precondition/postcondition forms a contract between?
the programmer who writes the function and the programmer who uses the function.
There is one difference between using old header file names (such as iostream.h) and the new names (iostream)
The new header files are part of a feature called the standard namespaces, also called std.
The statement used for the standard namespace
using namespace std;
its value will never be changed while the program is running
A declared constant
(True or False)
Once a constant has been declared, it can be used throughout the program
True
This indicates that the program is not allowed to change the variables value
use the keyword 'const' in front of a variable
Who is responsible for ensuring that the precondition is valid?
The programmer who uses the function
The first action of a function
Check that the precondition is valid
The assert facility is a good approach to?
detecting Invalid data at an early point
The assert facility uses what include directive?
#include <cassert>
Explain the assert function
Use the assert function to check if an expression is true or false, if its true its valid, if its false halt the program, and display error message
Give an example of the assert function in use
assert( c >= MINIMUM_CELSIUS);
Assertions can be turned off by placing this statement immediately before the programs include directives
#define NDEBUG
Where is the EXIT_SUCCESS constant defined in?
csdtdlib
What is commonly used for run time errors?
Exception handling
What are two considerations for selecting good sub tasks?
A) The potential for code reuse

B) The possibility of future changes to the program
What are the elements of a C++ prototype?
A function prototype consists of the return type, name, and parameter list, which are all followed by a semi-colon.
An assert statement that checks whether the month variable in the function date_check is a valid integer
assert(month > 0 && month <= 12);
The include directive that must appear before using the sqrt function
#include <cmath>
Why is it a good idea to stop a program a the earliest point when invalid data is detected?
Stopping early with an error message makes debugging easier
Time analysis
The reasoning about an algorithm's speed
Instead of measuring the actual elapsed time during each method
count certain operations that occur while carrying out the methods.
We do not usually measure the actual time taken to run the program because...
the number of seconds can depend on too many extraneous factors (such as speed of processor and if the processor is busy)
(true or false)

The speed of the processor is more important than the order of an algorithm
False, the order of an algorithm is more important
Linear Pattern
A loop that does a fixed amount of operations n times requires O(n) time.
Worst-Case analysis
Counting the maximum number of operations
Average-case analysis
Determines the average number of operations required for a given n.
Best-case analysis
determines the fewest number of operations required for given n.
Program testing
When you run a program and observe its behavior
Properties of Good Test Data

(2 answers)
1) You must know what output a correct program should produce for each test input

2) The test inputs should include those inputs that are most likely to cause errors
Boundary value

Explain and give an example
an input that is one step away from a different kind of behavior

int time_check(int hour);
// precondition: hour lies in range (0 <= hour <= 23)
Fully exercising code

(2 rules/answers)
1) Make sure that each line of your code is executed atleast once by some test data.

2) Test all conditions in your loop, like tests that skip certain procedures
What is a profiler?
A software tool that will generate a list indicating how often each statement of your program was executed.
Best practice for debugging
Limit code changes, find the exact culprit of the problem and fix the error, then rerun all the tests.