100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

COSC 1437 Review Final Exam Questions and Answers

Rating
-
Sold
-
Pages
27
Grade
A+
Uploaded on
06-12-2025
Written in
2025/2026

COSC 1437 Review Final Exam Questions and Answers

Institution
COSC
Course
COSC










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
COSC
Course
COSC

Document information

Uploaded on
December 6, 2025
Number of pages
27
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COSC 1437 Review Final Exam
Questions and Answers27

420 - ANSWERS-int puzzle(int start, int end)

{

if (start > end)

return start - end;

else if (start == end)

return start + end;

else

return end * puzzle(start + 1, end - 1);

}




Consider the accompanying definition of a recursive function. What is the output of the
following statement?



cout << puzzle(3, 7) << endl;



indirect - ANSWERS-Tracing through ____ recursion is more tedious than tracing other recursive
forms.



Statements in Lines 7-11 - ANSWERS-void printNum(int num) //Line 1

{ //Line 2

if (n < 0) //Line 3

,cout << "Num is negative" << endl; //Line 4

else if (num == 0) //Line 5

cout << "Num is zero" << endl; //Line 6

else //Line 7

{ //Line 8

cout << num << " "; //Line 9

printNum(num - 1); //Line 10

} //Line 11

} //Line 12

Consider the accompanying definition of a recursive function. Which of the statements
represent the general case?



10 - ANSWERS-int recFunc(int num)

{

if (num >= 10)

return 10;

else

return num * recFunc(num + 1);

}



Consider the accompanying definition of a recursive function. What is the output of the
following statement?



cout << recFunc(10) << endl;



static - ANSWERS-In ____ binding, the necessary code to call a specific function is generated by
the compiler.

, shallow - ANSWERS-In a ____ copy, two or more pointers of the same type point to the same
memory.



False - ANSWERS-[T/F] In C++, the dot operator has a lower precedence than the dereferencing
operator.



new - ANSWERS-The C++ operator ____ is used to create dynamic variables.



* - ANSWERS-In C++, you declare a pointer variable by using the ____ symb



43, 43 - ANSWERS-What is the output of the following code?



int *p;

int x;

x = 76;

p = &x;

*p = 43;

cout << x << ", " << *p << endl;



Increment - ANSWERS-Which of the following arithmetic operations is allowed on pointer
variables?



& - ANSWERS-In C++, ____ is called the address of operator.



*board[6] - ANSWERS-The statement that declares board to be an array of six pointers wherein
each pointer is of type int is: int ____________________;

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Bensuda Oxford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
847
Member since
3 year
Number of followers
445
Documents
21474
Last sold
2 days ago
ECONOMICS,NURSING,BIOLOGY AND ALL REVISION MATERIALS

DEDICATED TO PROVIDE YOU WITH THE BEST LEARNING MATERIALS THAT WILL IMPROVE YOUR GRADES ,WELCOME TO ALIZGRADES AND LETS DO IT TOGETHER!!! GOODLUCK!!!!!!!

3.7

158 reviews

5
74
4
24
3
25
2
11
1
24

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions