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

COMPUTER SCIENCE FINAL EXAM REVIEW QUESTIONS WITH ACCURATE SOLUTIONS RATED A.

Rating
-
Sold
-
Pages
74
Grade
A+
Uploaded on
12-02-2025
Written in
2024/2025

COMPUTER SCIENCE FINAL EXAM REVIEW QUESTIONS WITH ACCURATE SOLUTIONS RATED A.

Institution
Computer Science.
Course
Computer Science.











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

Written for

Institution
Computer Science.
Course
Computer Science.

Document information

Uploaded on
February 12, 2025
Number of pages
74
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COMPUTER SCIENCE FINAL EXAM REVIEW
QUESTIONS WITH ACCURATE SOLUTIONS
RATED A.
Given the following function definition:

void calc (int a, int& b)
{
int c;
c = a + 2;
a = a * 3;
b = c + a;
}

What is the output of the following code fragment that invokes calc?

int x = 1;
int y = 2;
int z = 3;
calc (x, y);
cout << x << ", " << y << ", " << z << endl;
1, 6, 3
T/F. Function without prototypes need to be before main () to be able to use
the in the main.
True
This function causes a program to terminate, regardless of which function or
control mechanism is executing.

,exit()
What is the output of the following program?

const int LIMIT = 50;
int AddEm (int x, int y);
}
int main ()
{
int x = 42, y = 35;
int total;
total = AddEm (x, y);
cout << "Total is: " << total << endl;
return 0;
}
int AddEm (int x, int y)
{
int total;
total = x + y;
if (total > LIMIT)
total = 0;
return (total);
}
None of these

- 50
- 42
- 35
- 77

,What is the output of the following program?

void showDub (int);
int main ()
{
int x = 2;
showDub (x);
cout << x << endl;
return 0;
}
void showDub (int num)
{
cout << (num * 2) << endl;
}
4
2
What is the output of the following program?

void doSomething (int);
int main ()
{
int x = 2;
cout << x << endl;
doSomething (x);
cout << x << endl;
return 0;
}
void doSomething (int num)
{

, num = 0;
cout << num << endl;
}
2
0
2
What is the output of the following program?

void doSomething (int&);
int main ()
{
int x = 2;
cout << x << endl;
doSomething (x);
cout << x << endl;
return 0;
}
void doSomething (int& num)
{
num = 0;
cout << num << endl;
}
2
0
0
What is the output of the following program?

int x = 1, y = 2, z = 3;
bool checkIt (int num);

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.
saraciousstuvia WALDEN UNIVERSITY
View profile
Follow You need to be logged in order to follow users or courses
Sold
551
Member since
3 year
Number of followers
380
Documents
11349
Last sold
2 weeks ago
BRIGHTEST IDEAS EDUCATIONAL WORLD

Welcome to the best educational world with the brightest,amazing and all complete study materials. I wish you great,easy learning and success through out your course. Kindly message me if you cant find your tutorials

4.0

112 reviews

5
61
4
20
3
17
2
3
1
11

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