Deck 6: Modularity Using Functions: Part I
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/51
العب
ملء الشاشة (f)
Deck 6: Modularity Using Functions: Part I
1
Terms used as synonyms for arguments are actual arguments and actual parameters.
True
2
Pass by value is also referred to as pass by reference.
False
3
Parameters are sometimes referred to as actual parameters.
False
4
Parameters are sometimes referred to as formal arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
5
The function declarator is sometimes referred to as function prototype.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
6
Random numbers are a series of numbers whose order cannot be predicted.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
7
Pseudorandom numbers are numbers which are not really random, but are sufficiently random for the task at hand.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
8
In earlier versions of C, function prototypes were required.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
9
In earlier versions of C, if a function header line omitted a return data type, the return value was, by default, implicitly declared as being of type void.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
10
In C, it is permitted to nest one function inside another.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
11
Each C function is a separate and independent entity with its own parameters and variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
12
When you write a function, you are formally creating a function definition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
13
The function's prototype, along with pre- and postcondition comments should provide a programmer with all the information necessary to call the function successfully.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
14
Postconditions are any set of conditions required by a function to be true if it is to operate correctly.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
15
All preprocessor directives, variables, named constants, and functions, except main(), must be either declared or defined before they can be used.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
16
A function returning a value must specify, in its header line, the data type of the value that will be returned.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
17
The parentheses in a return statement are required.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
18
Failure to exactly match the return value with the function's declared data type can lead to undesired results because the return value is always converted to the data type declared in the function's header line.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
19
The value of an expression can be explicitly converted into another type using the cast operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
20
A basic rule of testing states that each function should only be tested in a program in which all other functions are known to be correct.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
21
The standard C library consists of 5 header files.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
22
Placing the appropriate #include statement at the bottom of the program ensures proper access to the library functions whose prototypes are contained in the header file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
23
The rand() function produces a series of random numbers in the range 0 < rand() < RAND_MAX, where the constant RAND_MAX is a compiler-dependent symbolic constant that is defined in the stdlib.h header file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
24
Many C compilers have a randomize() routine that is defined using the srand() function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
25
The getcharacter() function can be used for single character input.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
26
There is no C string data type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
27
A function that is called or summoned into action by its reference in another function is a ____.
A)function prototype
B)called function
C)calling function
D)function declarator
A)function prototype
B)called function
C)calling function
D)function declarator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
28
A function that calls another function is referred to as the ____.
A)function prototype
B)called function
C)calling function
D)function declarator
A)function prototype
B)called function
C)calling function
D)function declarator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
29
A ____ declares the function to the compiler-it tells the compiler the name of the function, the data type of the value that the function will return (the keyword void indicates that the function will not be returning any value), and the data types of each argument that the function expects to receive when it is called.
A)function prototype
B)function header
C)function body
D)function declarator
A)function prototype
B)function header
C)function body
D)function declarator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
30
When a function simply receives copies of the values of the arguments and must determine where to store these values before it does anything else, this is known as a ____.
A)pass by value
B)pass by reference
C)stub
D)function declarator
A)pass by value
B)pass by reference
C)stub
D)function declarator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
31
The purpose of a ____ is to identify the data type of the value returned by the function, if any, provide the function with a name, and specify the number, order, and type of values expected by the function.
A)function declarator
B)prototype
C)function body
D)function header
A)function declarator
B)prototype
C)function body
D)function header
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
32
The purpose of a ____ is to operate on the passed data and return, at most, one value directly back to the calling function.
A)function declarator
B)prototype
C)function body
D)function header
A)function declarator
B)prototype
C)function body
D)function header
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
33
The argument names in the header line of a function are known as ____.
A)arguments
B)parameters
C)actual arguments
D)actual parameters
A)arguments
B)parameters
C)actual arguments
D)actual parameters
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
34
The portion of the function header that contains the function name and parameters is known as a ____.
A)function body
B)prototype
C)function declarator
D)stub
A)function body
B)prototype
C)function declarator
D)stub
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
35
The method for adjusting the random numbers produced by a random-number generator to reside within a specified range is called ____.
A)scaling
B)stubbing
C)prototyping
D)converting
A)scaling
B)stubbing
C)prototyping
D)converting
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
36
___ is an example of a function header line.
A)float roi(int, double);
B)float roi( int yrs, double rate);
C)printf("%f", roi(3, amt));
D)float roi( int yrs, double rate)
A)float roi(int, double);
B)float roi( int yrs, double rate);
C)printf("%f", roi(3, amt));
D)float roi( int yrs, double rate)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
37
___ is an example of a function prototype.
A)float roi(int, double);
B)roi(3, amt);
C)printf("%f", roi(3, amt));
D)float roi( int yrs, double rate)
A)float roi(int, double);
B)roi(3, amt);
C)printf("%f", roi(3, amt));
D)float roi( int yrs, double rate)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
38
___ is an example of a calling statement.
A)float roi(int, double);
B)float roi( int yrs, double rate);
C)printf("%f", roi(3, amt));
D)float roi( int yrs, double rate)
A)float roi(int, double);
B)float roi( int yrs, double rate);
C)printf("%f", roi(3, amt));
D)float roi( int yrs, double rate)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
39
____ is a prototype of a function that returns no value.
A)void funcA();
B)funcA();
C)int funcA();
D)null funcA();
A)void funcA();
B)funcA();
C)int funcA();
D)null funcA();
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
40
To return a value, a function must use a(n) ____ statement.
A)exit
B)throw
C)break
D)return
A)exit
B)throw
C)break
D)return
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
41
The minimum requirement of a ____ is that it compile and link with its calling module.
A)function body
B)function prototype
C)stub function
D)function declarator
A)function body
B)function prototype
C)stub function
D)function declarator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
42
___ is the correct way to include a header file in your program.
A)#include
B)#include header-file-name
C)#include;
D)#include header-file-name;
A)#include
B)#include header-file-name
C)#include
D)#include header-file-name;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
43
The function ____ returns the absolute value of its double-precision argument.
A)double ceil(double)
B)double fmod(double)
C)double fabs(double)
D)double abs(double)
A)double ceil(double)
B)double fmod(double)
C)double fabs(double)
D)double abs(double)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
44
The function ____ returns the common logarithm of its argument.
A)double exp(double)
B)double log(double)
C)double log10(double)
D)double fmod(double)
A)double exp(double)
B)double log(double)
C)double log10(double)
D)double fmod(double)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
45
The function ____ returns the natural logarithm of its argument.
A)double exp(double)
B)double log(double)
C)double log10(double)
D)double fmod(double)
A)double exp(double)
B)double log(double)
C)double log10(double)
D)double fmod(double)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
46
All C compilers provide ____ function(s) for creating random numbers, defined in the stdlib.h header file.
A)one
B)two
C)three
D)four
A)one
B)two
C)three
D)four
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
47
The ____ function can be used to generate a random number in C.
A)rand()
B)srand()
C)random()
D)rnd()
A)rand()
B)srand()
C)random()
D)rnd()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
48
____ reads the computer's internal clock time, in seconds.
A)stime()
B)time(SECONDS)
C)time()
D)time(NULL)
A)stime()
B)time(SECONDS)
C)time()
D)time(NULL)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
49
Scaling a random number as an integer value between 1 and N is accomplished using the expression ____.
A)1 + (int)rand() / N
B)1 + (int)rand() % N
C)(int)rand() / N
D)(int)rand() % N
A)1 + (int)rand() / N
B)1 + (int)rand() % N
C)(int)rand() / N
D)(int)rand() % N
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
50
The function ____ returns a non-0 number if the argument is a letter or a digit; otherwise it returns a 0.
A) int isalnum(int)
B) int isalpha(int)
C) int isdigit(int)
D) int isxdigit(int)
A) int isalnum(int)
B) int isalpha(int)
C) int isdigit(int)
D) int isxdigit(int)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck
51
The function ____ converts an ASCII string to an integer.
A) string itoa(int)
B) double atof(string)
C) int atoi(string)
D) int toupper(int)
A) string itoa(int)
B) double atof(string)
C) int atoi(string)
D) int toupper(int)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 51 في هذه المجموعة.
فتح الحزمة
k this deck