Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Term check:

Posted on 2004-09-20
4
Medium Priority
?
238 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

722 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