Solved

Term check:

Posted on 2004-09-20
4
229 Views
Last Modified: 2010-04-01
Please check for accuracy and correctiveness.

1.  When is it appropriate to use one-letter variable names?
-loop or counter variables
-variables in mathematical expression
-in all other cases do not do it

2. What are pre- and post- conditions and why are they useful?
-the precise conditions that must hold when a program begins and after it finishes.
-they are invariants.

3. Name and describe the three kinds of parameter passing mechanisms in C++.
-Input parameters, output parameters, and Inout parameters.
-input parameters should be passed by value whenever possible
-if passed by reference use const
-output and inout parameters must be passed by reference (& or *)

4. Give an example of when you should use each of the parameters described
   in #3.
-in C++ input parameters are often passed by value.
-Large objects should be passed by reference
-inout parameters are passed by reference

5. What is a program stub?
-a stub is a function with just enough code in it to get past the compiler.  You create a stub in order to test you program before writing full implementations of all functions.

6. What is the difference between stubs and drivers, and when should each be
   used?
-a driver is code written with the purpose of testing functions.  Drivers will be taken out when the code is fully debugged.
-a stub is partial function definition, not meant to be tested.
-both should be used during the debugging and refinement process of coding.

7. Give an example of and describe the scope and lifetime of each of the
   following identifiers or entities: not sure!!! please check and correct or add where applicable:-)
   * a local variable - int c; are defined in the function and exists only while the function is being executed.  They are not initialized before the function begins and are discarded when the function ends.  Alive when in memory.
   * an argument passed by reference: int size, &dynamic_array, i; void Life::initialize(int &x, int &y) { has to have a memory location.
   * an argument passed by value: int size, dynamic_array, i; void Life::initialize(int x, int y) { alive when in memory
   * a global variable: are used in the function but not defined in the function. alive when in memory
   * a static variable outside a class:static int maxrow = 20, maxcol = 60; is alive during complete execution of the program throughout the file. Has to have a memory location.
   * a function name: func_1(int, int);
   * a return value: return x;
   * a literal ???

8.  What is black-box testing?
-testing method that is usually more effective when recovering errors.

9.  What is top-down refinement?
-the real key to writing large programs that work.

10. What is modular programming?
-in glass box testing, the advantages of modular program design becomes evident.



0
Comment
Question by:edelossantos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 30

Accepted Solution

by:
Axter earned 500 total points
ID: 12105308
>>3. Name and describe the three kinds of parameter passing mechanisms in C++.

I think they're really looking for (1. by-valure, 2. by-ref, 3. by-pointer)
0
 
LVL 30

Expert Comment

by:Axter
ID: 12105323
>>4. Give an example of when you should use each of the parameters described
>>   in #3.

Change this to examples for by-value, by-ref, and by-pointers
0
 
LVL 30

Expert Comment

by:Axter
ID: 12105436
Number 7 needs a lot of work.

EE has rules against doing homework questions.
But we're aloud to help you with existing work.

Check out your book for by-reference and by-pointers definitions.
0
 

Author Comment

by:edelossantos
ID: 12105987
Great information.  Thank you Axter.  Del
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question