1.
In the following declaration, what is the return type?int myMethod(int count, double value) { return 4;}
A. 
B. 
C. 
D. 
E. 
2.
In the following function declaration, what is the name of the method?void showMenu(string category) {}
A. 
B. 
C. 
D. 
3.
In the following functiondeclaration, how many formal parameters are there?double squareRoot(double value) { return 2.3;}
A. 
B. 
C. 
D. 
4.
In the following function how many values are returned?void syncPhone(int idNumber) {}
5.
What word is missing below (fill in the __________). Write a function declaration called increaseTemperature which takes 2 integers as a formal parameters. The two parameters represent the upper and lower targets. The function returns the different between the upper and lower targets as an integer._________ increaseTemperature(int upper, int lower) { return upper - lower;}
6.
Write a function declaration for the following description (just the first line). The wording must be exact and correct!The method must be called calculateFinalExam. The method must return a double. The method accepts 3 parameters:1. the studentId which must be an integer2. the studentName which must be a String3. the testScore which must be a double.
7.
What is the output of this main() method? Put the letters into the answer box provided wih no spaces between (i.e. ABCEDFG)void showMenu() { cout << "Q";}void eraseFile() { cout << "T";}void processRequest() { cout << "2";} int main(int argc char *argv[]) { cout << "A"; processRequest(); cout << "B"; cout << "C"; showMenu(); cout << "D";}
8.
What is the output of this program? Put the letters into the answer box provided wih no spaces between (i.e. ABCEDFG)void showMenu() { cout << "Q";}void eraseFile() { cout << "T";}public static void processRequest() { cout << "2";} int main(int argc, char *argv[]) { cout << "A"; processRequest(); processRequest(); showMenu(); eraseFile(); cout << "B";}
9.
What is the output of this main() method? Put the letters into the answer box provided wih no spaces between (i.e. ABCEDFG)int main(int argc, char *argv[]) { showMenu(); eraseFile(); cout << "B"; showMenu();}void showMenu() { cout << "Q"; eraseFile();}void eraseFile() { cout << "T";}void processRequest() { cout << "2";}
10.
What is the output of this main() method? Put the letters into the answer box provided wih no spaces between (i.e. ABCEDFG)int getRemoteId() { return 3;}int getMonitorCount() { return 2;}int getStudentCount() { return 6;}int main(int argc, char *argv[]) { int value; cout << "@"; v = getRemoteId(); cout << v; cout << "E"; v = getStudentCount(); cout << v; cout << "F"; v = getMonitorCount(); cout << "W"; }
11.
The following code in the main is valid:void createGameCharacter() {}int main(int argc, char *argv[]) { int value; value = createGameCharacter(); // rest of program}
12.
The following code in the main is valid:int depositMoney() { return 4;}int main(int argc, char *argv[]) { int value; value = depositMoney(amount); // rest of program}
13.
What is the output of this main() method? Put the letters into the answer box provided wih no spaces between (i.e. ABCEDFG)void loadSong(int id) { cout << id;}int checkLength(int id) { cout << id; id = id + 4; cout << id; return 9;}int getStudentCount() { return 6;}int main(int argc, char *argv[]) { int value; loadSong(5); cout << "A"; value = checkLength(1); cout << "B"; cout << value; value = checkLength(4);}
14.
What is the output of this main() method? Put the letters into the answer box provided wih no spaces between (i.e. ABCEDFG)void loadSong(int id) { cout << id;}int checkLength(int id) { cout << id; id = id + 4; cout << id; return 9;}int getStudentCount() { return 6;}int main(int argc, char *argv[]) { int value; int x; x = 3; cout << "A"; value = checkLength(x); cout << "B"; cout << x; cout << value;}
15.
What is the output of this main() method? Put the letters into the answer box provided wih no spaces between (i.e. ABCEDFG)void showValues(int x, int y) { cout << x; cout << y; x = 4;}int checkLength(int id) { cout << id; id = id + 4; cout << id; return 9;}int getStudentCount() { return 6;}int main(int argc, char *argv[]) { int x; int y; x = 1; y = 2; showValues(y, x); cout << x; cout << y;}
16.
When the changeChannel() method is called below, what is the value of the parameter number?void changeChannel(int number) { // code is hidden} int main(int argc, char *argv[]) { int ch; ch = 240; changeChannel(ch + 10);}
17.
To call the function startCall() with the number 4432 and 3 retries what would you write in the main() function? Remember to put a ; at the end of the statement.void startCall(int number, int retries){ // code is hidden}
18.
What is the value that is returned in the following function?int getVolume() { int v; v = 23; if (v < 50) { return 50; } return v;}
A. 
B. 
C. 
D. 
19.
What is the output of the following program?int getFirstDigit(int value) { return value/10;}int getLastDigit(int value) { return value % 10;} int main(int argc, char *argv[]) { int x; int first; int second; x = 42; first = getFirstDigit(x); second = getSecondDigit(x); cout << second; cout << first;}
20.
True or False. The call to the function installApplication() is valid:void installApplication(string appName, int appVersion) { // rest of method not important} int main(int argc, char *argv[]) { installApplication("Angry Birds", "version 1.2");}