Test Bank Chapter 3 .ca



Chapter 3

Short Answer

1. Why is PI a const in the program that finds the area and circumference of a circle?

Answer: So that it cannot be changed during the run of the program.

2. What is the library function that finds the square root of a number sent to it?

Answer: sqrt

3. What is the value of y after the following code executes:

float y = 3.4 + sqrt (25.0);

Answer: 8.4

4. What is the library function that finds the absolute value of an integer?

Answer: abs

5. What is top-down design?

Answer: A method of solving a problem by breaking it into smaller parts.

6. What is a void function?

Answer: A function that does not return a value.

7. What is the output of this code, given the function definition that follows:

doSomething( );

doSomething( ); // code in main

void doSomething( ) { // function definition

cout ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download