Solved

Term check:

Posted on 2004-09-20
4
205 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

929 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now