• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 11 pages
Exam (elaborations)

CSCI Exam 2

Document preview thumbnail
Preview 2 out of 11 pages

CSCI Exam 2 Questions And Answers Latest 2026 Update!!!

Content preview

CSCI Exam 2
Read the following program:


#include <iostream>


void CalculateSum(int sum){
sum = 0;
for(int i = 0; i < 5; i++){
sum += i;
}
}

int main(){
a. argument
int sum = 0;
CalculateSum(sum); //(sum)
cout << sum << endl;
}


(sum) is best referred to as a(n) ______ when it is
used input to a function.
a. argument
b. global variable
c. parameter
d. static variable

A function can be re-used multiple times
True
throughout your program.

In C++ it is possible for a function to return
multiple independent values in a single return False
statement

In a function prototype, the names of the
True
parameter variables can be left out.

In the function definition below, csquared is known d.
aslocal
what
kind of variable?

, double pythag(double a, double b){
double csquared = pow(a, 2) + pow(b,2);
return csquared;
}


a. global
b. parameter
c. argument
d. local

In the function definition below, (int value1, int value2, int value3) are
known as what kind of variable?


int somefunction (int value1, int value2, int value3){
result = value1 * (value2 + value3) % value2;
result *= 7;
return result + 3;
value parameters
}


a. value parameters
b. global
c. reference parameters
d. arguments

A variable that is accessible by every function in
a program, including main, is called what?
a. local variable
b. global variable
b. global variable
c. static variable
d. program-wide variable

Many functions may have local variables with
True
the same name.

This statement causes a function to end and d. return
optionally send a value back to the part of the
program that called the function.
a. exit
b. quit
c. end

Document information

Uploaded on
April 8, 2026
Number of pages
11
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
1
Followers
0
Items
486
Last sold
2 months ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions