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)

COSC 1436 EXAM 2 ACTUAL EXAM COMPLETE QUESTIONS AND VERIFIED SOLUTIONS LATEST UPDATE THIS YEAR

Beoordeling
-
Verkocht
-
Pagina's
54
Cijfer
A+
Geüpload op
14-04-2026
Geschreven in
2025/2026

This is the ultimate study resource for the COSC 1436 (Programming Fundamentals I – C++) Exam 2. Updated for the 2026 academic year, this complete test bank contains actual exam questions and verified solutions covering all the essential topics you will face on your midterm or final. This comprehensive Q&A document mirrors the exact style, difficulty, and logic of questions you will encounter. From decision structures (if/else, switch) to loops (while, for, do-while), file I/O, and functions, every concept is covered with clear, verified answers.

Meer zien Lees minder
Instelling
COSC 1436
Vak
COSC 1436

Voorbeeld van de inhoud

COSC 1436 EXAM 2 ACTUAL EXAM COMPLETE QUESTIONS AND
VERIFIED SOLUTIONS LATEST UPDATE THIS YEAR
When an if statement is placed within the conditionally-executed code of another if
statement, this is known as:
A. nesting
B. complexity
C. None of these
D. validation
E. overloading - ANSWER-A. nesting


Given that x = 2, y = 1, and z = 0, what will the following cout statement display?
cout << "answer = " << (x || !y && z) << endl;


A. answer = 0
B. answer = 1
C. None of these
D. answer = 2 - ANSWER-B. answer = 1


These operators connect two or more relational expressions into one, or reverse the
logic of an expression. - ANSWER-logical


An expression that has any value other than 0 is considered true by and if
statement. (T/F) - ANSWER-True


What is the value of the following expression?
true && false - ANSWER-false


1

,Given the if/else statement:
if (a < 5)
b = 12;
else
d = 30;
Which of the following performs the same operation?


A. a >= 5 ? d = 30 : b = 12;
B. None of these
C. d = 30 ? b = 12 : a = 5;
D. b < 5 ? b = 12 : d = 30;
E. a < 5 ? b = 12 : d = 30; - ANSWER-E


What is the output of the following code segment if the user enters 90 for the
score?
cout << "enter your test score: ";
cin >> test_score;
if (test_score < 60)
cout << "You failed the test." << endl;
if (test_score > 60)
cout << "You passed the test." << endl;
else
cout << "You need to study harder next time." << endl;


A. You need to study harder next time.
B. You passed the test.

2

,You need to study harder next time.
C. You failed the test.
You need to study harder next time.
D. You passed the test.
E. You failed the test. - ANSWER-D


You should be careful when using the equality operator to compare floating point
values because of potential round-off errors. (T/F) - ANSWER-True


Which of the following is evaluated first, given the expression: A && B || C &&
!D


A. B || C
B. A && B
C. C && D
D. !D - ANSWER-D


Relational operators allow you to ________ numbers. - ANSWER-compare


The default section is required in a switch statement. (T/F) - ANSWER-False


What is the output of the following segment of code if the value 4 is input by the
user when asked to enter a number?
int num;
int total = 0;
cout << "Enter a number from 1 to 10: ";


3

, cin >> num;
switch (num)
{
case 1:
case 2: total = 5;
case 3: total = 10;
case 4: total = total + 3;
case 8: total = total + 6;
default: total = total + 4;
}
cout << total << endl; - ANSWER-13 (Fall through adds 3, then 6, then 4)


Which line in the following program will cause a compiler error?
1 #include <iostream>
2 using namespace std;
3 int main()
4{
5 int number = 5;
6 if (number >= 0 && <= 100)
7 cout << "passed. \n";
8 else
9 cout << "failed. \n";
10 return 0;
11 } - ANSWER-Line 6 (Missing variable "number" on the right side of the AND
operator)


4

Geschreven voor

Instelling
COSC 1436
Vak
COSC 1436

Documentinformatie

Geüpload op
14 april 2026
Aantal pagina's
54
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$14.79
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

Maak kennis met de verkoper
Seller avatar
VeritasShelf1

Maak kennis met de verkoper

Seller avatar
VeritasShelf1 Chamberlain College Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
4
Lid sinds
2 maanden
Aantal volgers
0
Documenten
232
Laatst verkocht
3 weken geleden
veritas Shelf

Welcome to Veritas Shelf the secret weapon every student wishes they had. We take the guesswork out of studying by providing you with the exact tools you need to walk into that exam hall with your head held high. Forget digging through endless textbooks. We’ve compiled the most efficient study aids, including past papers, practice questions, and comprehensive summaries, all in one place. Whether you\'re aiming for a passing grade or aiming for honors, we have the roadmap to get you there.

Lees meer Lees minder
0.0

0 beoordelingen

5
0
4
0
3
0
2
0
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