Back to marketplace

U2: Summative

No description yet. This curated deck is ready for daily study.

Total cards: 8•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (8)

#1
Front (Question)

Counters and Scores

Back (Answer)

Use technique variable = variable + 1 for adding score

#2
Front (Question)

Variables using Custom Data Types (Classes)

Back (Answer)

• All programs written in Java contain classes • Examples of custom data types: Strings from String Class, Scanner from Scanner Class

#3
Front (Question)

Predefined Subprograms

Back (Answer)

• Pre-existing program allowing task to be accomplished quickly • Ex: Math.round(), Integer.ParseInt()

#4
Front (Question)

Random Numbers

Back (Answer)

• randomNumber = (int)Math.round(Math.random()*[n-1]+1) • Generates between 1 and n

#5
Front (Question)

Creating Random Object

Back (Answer)

• Random random = new Random() • Written at start of program to allow random values to come

#6
Front (Question)

Casting a Value to Double

Back (Answer)

• Add (double) at the left of variable • Ex: int numCorrect; (double) numCorrect • Can cast to integer, other value as well

#7
Front (Question)

break (code)

Back (Answer)

Ends a program

#8
Front (Question)

.equals Subroutine

Back (Answer)

• Used for strings instead of the == sign • Ex: if (variable1.equals (variable2))