Karteikarten
Computing I Packet 3
Karten in diesem Stapel (31)
- 1Variables that are declared inside a funcion are said to be _____ to that function.Local
- 2What is the output produced by the following code fragment? int i = 3; printf("%.2f\n", sqrt(pow(i, 4.0)));9.00
- 3Converting from one type to another is called _____.type casting
- 4#include is known as an _____.include directive
- 5The _____ of a variable is where that variable can be used.scope
- 6When you want to execute a function in your program, you would make a function _____.call
- 7A problem-solving approach that starts with the big problem and breaks it down into smaller pieces is called _____.top-down design
- 8The _____ describes how the function will work.body
- 9In the following function declaration, the variable size is known as a _____. int myFunction (int size);formal parameter
- 10The absolute value function abs is located in the _____ library.stdlib.h
- 11Algorithms are typically described in _____.pseudo code
- 12The black box analogy demonstrates the concept of _____.procedural abstraction
- 13Write the code to convert the value in an integer variable named count to a temporary double.(double) count
- 14Constant variables that might be used in different functions should be _____.global
- 15If the variable x of type double has the original value of 3.4, what is the value in x after the following? printf("%d\n", (int) x);3.4
- 16The fabs(double num) function a. returns the largest whole number <= num b. returns the absolute value of num c. returns the negative value of num d. returns the most fabulous numberb. returns the absolute value of num
- 17Which of the following is not a legal function declaration? a. int ave3(int, int, int); b. int ave3(int a, int b, int c); c. int 3ave(int a, int b, int c); d. int ave_3(int a1, int a2, int a3);c. int 3ave(int a, int b, int c);
- 18What is the output of the following program segment? // function body int factorial (int n) { int product = 0; while (n > 0) { product = product * n; n--; } return product; } // program segment printf("%d\n", factorial(4));0
- 19The expression (double) 3 is called a _____.type cast
- 20What is the output of the following code fragment? double size, volume = 16.0; size = sqrt(sqrt(volume)) / 3; printf("%.2f\n", size);0.67
- 21What is the output of the following program fragment? printf("%g\n"); pow(4.0, 2.0));16
- 22When parameters are passed between the calling code and the called function, parameters, and arguments are matched by a. their relative positions in the parameter and argument lists b. their names c. their data types d. they are not matched up at alla. their relative positions in the parameter and argument lists
- 23If you need to write a function that will compute the cost of some candy, where each piece costs 25 cents, which would be an appropriate function declaration? a. int calculatorCost (char name); b. int calculateCost int count; c. int calculateCost (int count); d. char carculateCost (int count);c. int calculateCost (int count);
- 24Using functions in a program is known as _____.procedural abstraction
- 25Multiple arguments to a function are separated by _____.commas
- 26The functions pow(), sqrt(), and fabs() are found in which include file?math.h
- 27What is the value returned by the following function? int function (void) { int value = 35; return value + 5; value += 10; }40
- 28What is the value of x after the following code fragment executes? double x = 36.0; x = sqrt(x);6.0
- 29What is the function of i after the doSomething(i) function call? //function definition int doSomething (int value) { value = 35; return value; value = 13; } // fragment of main program int i = 0; printf("%d\n", doSomething(i));0
- 30If you have the following variable declaration in your program, const int SIZE = 34; then which of the following statements are legal? a. x = SIZE--; b. SIZE = SIZE +1; c. SIZE++; d. printf("%d\n", SIZE);d. printf("%d\n", SIZE);
- 31—
Informationen
- Beschreibung
- Karteikarten am Computing I Packet 3, erstellt von Vanessa Chen am 05/05/2019.
- Erstellt von
- Vanessa Chen
- Aufrufe
- 0
- Bewertung