Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

COP 3330 FSU EXAM 1 QUESTIONS WELL ANSWERED LATEST UPDATE 2026

Beoordeling
-
Verkocht
-
Pagina's
8
Cijfer
A+
Geüpload op
16-05-2026
Geschreven in
2025/2026

COP 3330 FSU EXAM 1 QUESTIONS WELL ANSWERED LATEST UPDATE 2026 Which of the following code fragments produces the output: z = 1.5 a) int x = 1; int y = 2; float z = (x + y)/2; std::cout "z = " z 'n'; b) int x = 1; int y = 2; float z = x + y; std::cout "z = " z/2 'n'; c) int x = 1; int y = 2; float z = x/2 + y/2; std::cout "z = " z 'n'; d) int x = 1; int y = 2; float z = (x + y)/y; std::cout "z = " z 'n'; - Answers int x = 1; int y = 2; float z = x + y; std::cout "z = " z/2 'n'; Given the declarations int A [20]; int * p = A; Which of the following does not output the index 3 element of A? a) A += 3; std::cout *A; b) std::cout *(p + 3); c) std::cout A[3]; d) std::cout *(A + 3); e) p += 3; std::cout *p; f) std::cout p[3]; - Answers A += 3; std::cout *A; What will the following program segment do? int counter = 1; do { std::cout counter ' '; } while (++counter = 10); a) Print the integers 1 through 11 b) Print the integers 1 through 10 c) Print the integers 1 through 9 d) Cause a syntax error - Answers Print the integers 1 through 10 Which of the following is not true about a for loop structure? a) The three expressions in the for header are optional b) A for loop can always be used to replace a while loop, and vice versa c) The initialization and increment expressions can be comma-separated lists d) You must declare the control variable outside of the for loop - Answers You must declare the control variable outside of the for loop What is the output from the following code fragment? int n = 2; int m; ++n; m = n--; std::cout m ' ' n 'n'; a) 3 2 b) 2 3 c) 2 2 d) 3 3 - Answers 3 2 Which of the following is true about C-strings? a) Using functions from cstring on C-strings that are not null-terminated has unpredictable results b) There is an implicit assumption that they are null-terminated, but this is usually left to the programmer to enforce c) The function strcpy(str1, str2) copies the characters in str2 to str1 after first checking to make sure that str1 has enough allocated memory to receive them d) The function strlen(c) returns the number of characters allocated to c e) C-strings are a proper type f) Space for C-strings is allocated automatically - Answers Using functions from cstring on C-strings that are not null-terminated has unpredictable results There is an implicit assumption that they are null-terminated, but this is usually left to the programmer to enforce Consider the following function prototype: void Funky (const int * a, size_t size); and suppose your have a client program with an array declared as follows: int intArray[20]; a) The call Funky(intArray,10); is not allowed to change the value of intArray. b) The call Funky(intArray,10); will likely result in a compile error. c) The call Funky(intArray,20) is allowed to change the value intArray[20]. d) The call Funky(intArray,10) is not allowed to change the value of intArray[5]. - Answers The call Funky(intArray,10) is not allowed to change the value of intArray[5] Consider the following program: int F(int a, int& b) { a = a - 1; b = b - 1; return a + b; } int main() { int x,y,z; x = 2; y = 3; z = 4; std::cout "x = " x 'n' "y = " y 'n' "z = " z 'n'; } What is the screen output? a) x = 2 y = 3 z = 4 x = 2 y = 3 z = 4 b) x = 1 y = 2 z = 3 x = 2 y = 2 z = 5 c) x = 2 y = 3 z = 4 x = 2 y = 2 z = 5 d) x = 2 y = 3 z = 4 x = 2 y = 2 z = 3 - Answers x = 2 y = 3 z = 4 x = 2 y = 2 z = 3 Given the class definition: class Cylinder { public: Cylinder (float length = 1, float radius = 1); virtual ~Cylinder(); float Volume() const; private: float length_, radius_; }; Which of the following correctly declares an object variable of type Cylinder? a) class Cylinder c; b) c Cylinder (2,4); c) Cylinder c(2,4); d) Cylinder c(); e) Cylinder c; - Answers Cylinder c(2,4); Cylinder c; Modularity in C++ is achieved using... a) Do statements b) While statements c) If statements d) Switch statements e) Declared constants f) Namespaces g) Functions f) Classes - Answers Namespaces Functions Classes A class destructor a) may have any number of parameters b) must be paired with each constructor for the class c) will be created automatically if none is supplied by the programmer d) is responsible for de-allocating resources when an object goes out of scope e) is called by operator new f) is called by operator delete g) must be supplied with the class if a constructor is also supplied h) is called multiple times by an operator delete [] - Answers will be created automatically if none is supplied by the programmer is responsible for de-allocating resources when an object goes out of scope is called by operator delete is called multiple times by an operator delete []

Meer zien Lees minder
Instelling
COP 3330
Vak
COP 3330

Voorbeeld van de inhoud

COP 3330 FSU EXAM 1 QUESTIONS WELL ANSWERED LATEST UPDATE 2026

Which of the following code fragments produces the output:

z = 1.5

a)
int x = 1;
int y = 2;
float z = (x + y)/2;
std::cout << "z = " << z << '\n';

b)
int x = 1;
int y = 2;
float z = x + y;
std::cout << "z = " << z/2 << '\n';

c)
int x = 1;
int y = 2;
float z = x/2 + y/2;
std::cout << "z = " << z << '\n';

d)
int x = 1;
int y = 2;
float z = (x + y)/y;
std::cout << "z = " << z << '\n'; - Answers int x = 1;
int y = 2;
float z = x + y;
std::cout << "z = " << z/2 << '\n';
Given the declarations

int A [20];
int * p = A;

Which of the following does not output the index 3 element of A?

a)
A += 3;
std::cout << *A;

b)
std::cout << *(p + 3);

c)
std::cout << A[3];

d)
std::cout << *(A + 3);

e)
p += 3;
std::cout << *p;

f)

, std::cout << p[3]; - Answers A += 3;
std::cout << *A;
What will the following program segment do?

int counter = 1;
do
{
std::cout << counter << ' ';
}
while (++counter <= 10);

a) Print the integers 1 through 11
b) Print the integers 1 through 10
c) Print the integers 1 through 9
d) Cause a syntax error - Answers Print the integers 1 through 10
Which of the following is not true about a for loop structure?

a) The three expressions in the for header are optional
b) A for loop can always be used to replace a while loop, and vice versa
c) The initialization and increment expressions can be comma-separated lists
d) You must declare the control variable outside of the for loop - Answers You must declare the
control variable outside of the for loop
What is the output from the following code fragment?

int n = 2;
int m;
++n;
m = n--;
std::cout << m << ' ' << n << '\n';

a) 3 2
b) 2 3
c) 2 2
d) 3 3 - Answers 3 2
Which of the following is true about C-strings?

a) Using functions from <cstring> on C-strings that are not null-terminated has unpredictable results
b) There is an implicit assumption that they are null-terminated, but this is usually left to the
programmer to enforce
c) The function strcpy(str1, str2) copies the characters in str2 to str1 after first checking to make sure
that str1 has enough allocated memory to receive them
d) The function strlen(c) returns the number of characters allocated to c
e) C-strings are a proper type
f) Space for C-strings is allocated automatically - Answers Using functions from <cstring> on C-strings
that are not null-terminated has unpredictable results

There is an implicit assumption that they are null-terminated, but this is usually left to the
programmer to enforce
Consider the following function prototype:

void Funky (const int * a, size_t size);

and suppose your have a client program with an array declared as follows:

int intArray[20];

a)

Geschreven voor

Instelling
COP 3330
Vak
COP 3330

Documentinformatie

Geüpload op
16 mei 2026
Aantal pagina's
8
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$11.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF


Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
joshuawesonga22 Liberty University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
99
Lid sinds
1 jaar
Aantal volgers
1
Documenten
14163
Laatst verkocht
6 uur geleden
Tutor Wes

Hi there! I'm Tutor Wes, a dedicated tutor with a passion for sharing knowledge and helping others succeed academically. All my notes are carefully organized, detailed, and easy to understand. Whether you're preparing for exams, catching up on lectures, or looking for clear summaries, you'll find useful study materials here. Let’s succeed together!

3.9

9 beoordelingen

5
4
4
1
3
3
2
1
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen