
Quiz 2 - Part 1
Authored by Joseph Tom
Computers
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Given (using C++)
int&a = 10;
what is the value of a++
cannot do address arithmetic on references
addr(a) + 4
11
a constant cannot be assigned to a reference
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
In Python, if
a = [10,12,15,16],
what is the value of a after
for (i in len(a)):
a[i]=a[i]+1
the stmt is meaningless and should be changed to "for (i in range(len(a))):"
[11,13,16,17]
the stmt is meaningless and should be changed to "for (i in a):"
a is immutable and hence illegal
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
(Python) if a is [1,1,1,1], what is the value of a after
for i in a:
a[i] = a[i]+1
not a meaningful stmt syntactically
[1,3,3,1]
[2,2,2,2]
index out of range error
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Let (C++)
int a = 5; int&i = a;
what is the value of a after
i++; a += 24
29
30
aliasing makes the value of a indeterminate
cannot assign a to i
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Stmts like a = a++ are best avoided in C++ because
cannot have a as lvalue and rvalue in the same stmt
it can get confused as (a=a)++
it has unsequenced updates
it is meaningless as a cannot be equal to its incremented value
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
int vect[] = {10, 20, 30, 40};
for (int& x: vect) x = x + 5;
What is the value of vect?
cannot be computed as x does not have an initialization
as vect is not updated, value remains same as before
{15,25,35,45}
vect[] is not a correct decl & hence will not compile
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
if int a[i] is 10 and a[i] = a[i]+1;
lvalue in the assg is (in C or C++)
10
11
addr(a)
addr(a)+4*i
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
18 questions
PRUEBA FINAL COMPUTACION
Quiz
•
1st Grade - University
20 questions
DI (EM24) - Diseño de Contenidos (T8)
Quiz
•
University - Professi...
15 questions
Cuestionario sobre seguridad en línea
Quiz
•
2nd Grade - University
20 questions
COA_QUIZ_UNIT I
Quiz
•
University
21 questions
CPA MS-Office Hotkeys Quiz
Quiz
•
8th Grade - Professio...
16 questions
Algo Quiz
Quiz
•
University
19 questions
Informatika Kelas 5 Bab 2
Quiz
•
5th Grade - University
18 questions
Quiz on Misinformation and Bias
Quiz
•
10th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
7 questions
Fragments, Run-ons, and Complete Sentences
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
10 questions
DNA Structure and Replication: Crash Course Biology
Interactive video
•
11th Grade - University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
5 questions
Examining Theme
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University