
Variables and Assignments
Authored by Ms Seccafico
Computers
12th Grade
Used 91+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
The variable age is to be used to represent a person’s age, in years. Which of the following is the most appropriate data type for age ?
Boolean
number
string
list
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
The variable is Open is to be used to indicate whether or not a store is currently open. Which of the following is the most appropriate data type for isOpen ?
Boolean
number
string
list
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment.
What is the value of r as a result of executing the code segment?
10
20
30
40
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment.
What are the values of first and second as a result of executing the code segment?
The value of first is true, and the value of second is true.
The value of first is true, and the value of second is false.
The value of first is false, and the value of second is true.
The value of first is false, and the value of second is false.
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a benefit of using a list as a data abstraction in a program?
Lists often allow their size to be easily updated to hold as many data values as needed.
Lists convert all elements to strings so that they can be inspected character-by-character.
Lists prevent duplicate data values from appearing in the list.
Lists are used to store all input data so that there is a running record of all user input.
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
A programmer has a need to round many numeric values to the nearest integer. Which of the following best explains the benefit of using a list as a data abstraction in this situation?
Keeping the numeric values in a list makes it easier to round a number to the nearest integer.
Keeping the numeric values in a list makes it easier to apply the same computation to every data element.
Keeping the numeric values in a list makes it easier to prevent a program from unintentionally changing the value of a variable.
Keeping the numeric values in a list makes it easier to prevent a program from attempting to access an index beyond the length of the list.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Assume that both lists and strings are indexed starting with index 1.
The list wordList has the following contents.
["abc", "def", "ghi", "jkl"]
Let myWord be the element at index 3 of wordList. Let myChar be the character at index 2 of myWord. What is the value of myChar ?
"e"
"f"
"h"
"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
10 questions
JSPS Competition Hackathon - Scratch Language - Grade 1
Quiz
•
2nd Grade - University
10 questions
Microcontroller
Quiz
•
11th Grade - University
14 questions
Input, output and storage de
Quiz
•
8th Grade - Professio...
10 questions
ZOOM QUIZ
Quiz
•
1st - 12th Grade
15 questions
Visual C# Quiz - Chapter 5: Loops, Files, and Random Numbers
Quiz
•
12th Grade
13 questions
bts
Quiz
•
KG - Professional Dev...
15 questions
Unit 14: B4 - Information and Data Dissemination Quiz
Quiz
•
12th Grade
10 questions
EMPTECH L4 Q3
Quiz
•
12th Grade
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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade