1.6.2: A First Program (Participation Activity)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/5

Last updated 8:25 PM on 3/20/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

6 Terms

1
New cards
<p>Program execution begins at main() and executes statements surrounded by which symbols?</p>

Program execution begins at main() and executes statements surrounded by which symbols?

{} (Explanation: The statements within main() are contained within { }, called curly braces. The { indicates the start of main's statements, and the } indicates the end of main's statements, here meaning the end of the program.)

2
New cards
<p>The statement <code>int wage;</code> creates a variable named wage that is used to _____ the value 20.</p>

The statement int wage; creates a variable named wage that is used to _____ the value 20.

hold (Explanation: The variable wage holds the value 20. The variable wage can be assigned with a different value later in the program, so because the value held can vary, the item is called a variable. Program variables are different from variables in algebra.)

3
New cards
<p>Would the following order of statements work the same as above? </p><pre><code>wage = 20;
int wage;</code></pre><p></p>

Would the following order of statements work the same as above?

wage = 20;
int wage;

No (Explanation: This order doesn't work. Statements are executed one at a time, starting from the first statement after the opening {. The program must first create the variable wage to hold a value, and only then can assign wage with the value 20. As an analogy, in everyday life, the instructions "Get a teapot. Fill with water." make sense. But the reverse-order "Fill with water. Get a teapot." make no sense, and water will end up on the floor.)

4
New cards
<p>Each statement ends with what symbol?</p>

Each statement ends with what symbol?

Semicolon ; (Explanation: Like a period ends an English sentence, a semicolon ends a program statement. Even though each statement is usually written on a unique line, a semicolon is needed as a separator because multiple statements could appear on the same line (though that practice is strongly discouraged)).

5
New cards
<p>The expression wage <em> 40 </em> 52 resulted in what value?</p>

The expression wage 40 52 resulted in what value?

41600 (Explanation: The variable wage holds 20, so wage 40 52, will calculate 20 40 52, which is 41600. Note that the symbol for multiplication is * (an asterisk)).

6
New cards
<p>Each System.out.print() and System.out.println() statement outputs items to _____.</p>

Each System.out.print() and System.out.println() statement outputs items to _____.

The screen (Explanation: In the example, each System.out.print() or System.out.println() statement puts an item on the screen, starting at the screen cursor's present location, and moving the cursor after each output item. System.out.print() just prints the item. System.out.println() prints the item and then moves the cursor to the next line.)

Explore top notes

note
WHAP - Unit 2 Review
Updated 528d ago
0.0(0)
note
2.1 Physical and Mental Health
Updated 1102d ago
0.0(0)
note
THE NEW NATION
Updated 633d ago
0.0(0)
note
Chapter 13 - Chemical Equilibrium
Updated 1437d ago
0.0(0)
note
WHAP - Unit 2 Review
Updated 528d ago
0.0(0)
note
2.1 Physical and Mental Health
Updated 1102d ago
0.0(0)
note
THE NEW NATION
Updated 633d ago
0.0(0)
note
Chapter 13 - Chemical Equilibrium
Updated 1437d ago
0.0(0)

Explore top flashcards

flashcards
cogni
400
Updated 783d ago
0.0(0)
flashcards
Latin Exam Vocabulary
437
Updated 309d ago
0.0(0)
flashcards
[ 2MID ] MIL - What is Media?
40
Updated 207d ago
0.0(0)
flashcards
LV - Python
20
Updated 1040d ago
0.0(0)
flashcards
Unit 2: Cognition
50
Updated 9d ago
0.0(0)
flashcards
unit 2 vocab
140
Updated 1183d ago
0.0(0)
flashcards
cogni
400
Updated 783d ago
0.0(0)
flashcards
Latin Exam Vocabulary
437
Updated 309d ago
0.0(0)
flashcards
[ 2MID ] MIL - What is Media?
40
Updated 207d ago
0.0(0)
flashcards
LV - Python
20
Updated 1040d ago
0.0(0)
flashcards
Unit 2: Cognition
50
Updated 9d ago
0.0(0)
flashcards
unit 2 vocab
140
Updated 1183d ago
0.0(0)