Consider the following code segment which uses the variables r, s, and t.
4 <- 1
s <- 2
t <- 3
r <- s
s <- t
DISPLAY(r)
DISPLAY(s)
What is displays as a result of running the code segment?
APCS Principles Practice Exam
Quiz
•
Computers
•
8th Grade - University
•
Medium
Thomas Wright
Used 41+ times
FREE Resource
75 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment which uses the variables r, s, and t.
4 <- 1
s <- 2
t <- 3
r <- s
s <- t
DISPLAY(r)
DISPLAY(s)
What is displays as a result of running the code segment?
1 1
1 2
2 3
3 2
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a true statement about program documentation?
Program documentation should not be changed after it is first written
Program documentation is only needed for programs in development; it is not needed after a program is completed
Program documentation is useful when programmers collaborate but not when a programmer works individually on a project
Program documentation is useful during initial program development and also when modifications are made to existing programs
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following best explains what happens when a new device is connected to the Internet?
A device Driver is assigned to the device
An IP address is assigned to the device
A packet number is assigned to the device
A Web site is assigned to the device
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the code segment.
Which of the following replacements for <MISSING CONDITION> will result in an infinite loop?
j = 6
j ≥ 6
j = 7
j > 7
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The algorithm below is used to simulate the results of flipping a coin 4 times. Consider the goal of determining whether the simulation resulted in an equal number of heads and tails
Step 1: Initialize the heads_counter and flip_counter to 0
Step 2: A variable coin_flip is randomly assigned a value of either 0 or 1.
Step 3: Increment the value of flip_counter by 1.
Step 4: Repeat step 2 and 3 until flip_counter equals 4
Following execution of the algorithm, which of the following expressions indicates that the simulation resulted in an equal number of heads and tails?
coin_flip = 1
flip_counter = 1
flip_counter = 2
heads_counter = 2
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
An algorithm has been developed to compute the sum of all the elements in a list of integers. Which of the following programming structures must be added to the existing algorithm so that the new algorithm computes the sum of only the even integers in the list?
Iteration
Searching
Selection
Sequencing
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following activities poses the greatest personal cybersecurity risk?
Making a purchase at an online store that uses public key encryption to transmit credit card information
Paying a bill using a secure electronic payment system
Reserving a hotel room by e-mailing a credit card number to a hotel
Withdrawing money from a bank account using an automated teller machine
70 questions
S3 Computer Systems Unit 2 Assessment
Quiz
•
7th Grade - University
70 questions
APP 001 EXAMINATION REVIEW
Quiz
•
11th Grade
75 questions
ITF+ Practice Exam 4
Quiz
•
9th Grade
70 questions
C Programming
Quiz
•
University
80 questions
year 7
Quiz
•
6th - 8th Grade
75 questions
Computer Science - End of Year Quiz
Quiz
•
10th Grade
80 questions
Premiere Pro
Quiz
•
8th - 10th Grade
74 questions
Code.org: Fundamentals of Computing Final Exam 2019 - 2020
Quiz
•
7th - 10th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
25 questions
Spanish preterite verbs (irregular/changed)
Quiz
•
9th - 10th Grade
10 questions
Identify Slope and y-intercept (from equation)
Quiz
•
8th - 9th Grade
67 questions
Course Recap Ptho May25
Quiz
•
University
10 questions
Juneteenth: History and Significance
Interactive video
•
7th - 12th Grade
15 questions
Volume Prisms, Cylinders, Cones & Spheres
Quiz
•
8th Grade
8 questions
"Keeping the City of Venice Afloat" - STAAR Bootcamp, Day 1
Quiz
•
9th - 12th Grade