Prog2 - Q

advertisement
Kingdom of Saudi Arabia
Ministry of Higher Education
Majmaah University
Collage of Science at Al-Zulfi
Computer & Information Dept.
Quize(1) in Programming (2)
11-5-1436
Name:
1.
‫المملكة العربية السعودية‬
‫وزارة التعليم العالي‬
‫جامعة المجمعــة‬
‫كلية العلوم بالزلفي‬
‫قسم علوم الحاسب والمعلومات‬
ID:
void functionA( void );
a. It does not receive any arguments.
b. It could have been written void functionA( );
c. It does not return a value.
d. All of the above
2. A function argument is
a. a variable in the function that receives a value from the calling program.
b. a way that functions resist accepting the calling program’s values.
c. a value sent to the function by the calling program.
d. a value returned by the function to the calling program.
3. When an argument is passed by reference '&'
a. a variable is created in the function to hold the argument’s value.
b. the function cannot access the argument’s value.
c. a temporary variable is created in the calling program to hold the argument’s
value.
d. the function accesses the argument’s original value in the calling program.
4. Overloaded functions
a. are a group of functions with the same name.
b. all have the same number and types of arguments.
c. make life simpler for programmers.
d. may fail unexpectedly due to stress.
5. A static local variables exist for
a. the life of a program but are visible only in their own functions.
b. the life of a program but are visible only in their overloaded functions.
c. only while the function in which they are defined is executing.
the life of a program
___________________________________________________________________________
A) Write a structure specification that includes three variables—all of type int—called
hrs, mins, and secs. Call this structure time
B) Write a function with an argument of type time structure to Compute and Print
the total number of seconds represented by time:
c) Write a function has two integer variables arguments such to add 5
to the minimum variable and to add 10 to the maximum other ? Call it
from main function?
Download