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 ?

Variables and Assignments

Quiz
•
Computers
•
12th Grade
•
Hard
Ms Seccafico
Used 90+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
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"
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Topic 3 & 4 Practice - ArrayList and String Methods

Quiz
•
12th Grade
15 questions
AP CSP Algorithms & Programming (College Board Style)

Quiz
•
9th - 12th Grade
10 questions
Arrays and Lists

Quiz
•
6th - 12th Grade
10 questions
AP Computer Science Principles Unit 3 Review

Quiz
•
9th - 12th Grade
12 questions
Unit 5 Lists, Loops, & Traversals

Quiz
•
10th - 12th Grade
15 questions
AQA Computer Science GCSE - 3.1 Fundamentals of algorithms

Quiz
•
10th - 12th Grade
10 questions
Python Generators

Quiz
•
10th Grade - University
10 questions
AP CSA Unit 1 & 2 Review

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade