AP CSA Unit 2: Lesson 2 Questions

0.0(0)
Studied by 9 people
0%Exam Mastery
Build your Mastery score
multiple choiceAP Practice
Supplemental Materials
call kaiCall Kai
Locked
Card Sorting

1/9

flashcard set

Earn XP

Last updated 9:52 PM on 9/24/22
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

10 Terms

1
New cards
How could you create a String variable, s, and set it equal to "Fast Start" in one line?
String s = "Fast Start";
2
New cards
Consider the following code:
int x = 13;
int y = 7;
System.out.println(x % y);
What is the output?
6
3
New cards
What is a double?
A double is a primitive data type so a double variable directly stores the data for the double.
4
New cards
Consider the following code:
int x = 27;
int y = 13;
System.out.print("Answer: " + x + y);
This code outputs:
Answer: 2713
True
5
New cards
Consider the following code:
System.out.println("Answer: " + (3 + 7));
This code outputs:
Answer: 10
True
6
New cards
What will be printed by the following code?
System.out.println("I came,\tI saw,\n\tI left.");
I came, I saw,
I left.
7
New cards
To output:
Nums: [31, 43, 28, 17
]
You would need to use what escape sequence in the blank:
System.out.print("Nums: [31, 43, 28, 17____]");
\n
8
New cards
Which of the following symbols need an escape character to be output in a System.out.print statement?
\
9
New cards
What does \t do?
It puts a tab space in between two characters
10
New cards
Consider the following code:
System.out.println("Answer: " + (5.0 + 9));
This code outputs:
Answer: 14
False