• Java Arrays
  • Java Strings
  • Java Collection
  • Java 8 Tutorial
  • Java Multithreading
  • Java Exception Handling
  • Java Programs
  • Java Project
  • Java Collections Interview
  • Java Interview Questions
  • Spring Boot

Compound assignment operators in Java

  • Java Assignment Operators with Examples
  • Basic Operators in Java
  • Bitwise Operators in Java
  • Difference between Simple and Compound Assignment in Java
  • Java Arithmetic Operators with Examples
  • Interesting facts about Increment and Decrement operators in Java
  • Java Logical Operators with Examples
  • Java | Operators | Question 8
  • Java | Operators | Question 1
  • Java | Operators | Question 3
  • Java | Operators | Question 7
  • Java | Operators | Question 4
  • Assignment Operators in C
  • Assignment Operators In C++
  • Augmented Assignment Operators in Python
  • Assignment Operators in Programming
  • Operators in Java
  • Solidity - Assignment Operators
  • Arithmetic Operators in Solidity
  • Arrays in Java
  • Spring Boot - Start/Stop a Kafka Listener Dynamically
  • Parse Nested User-Defined Functions using Spring Expression Language (SpEL)
  • Split() String method in Java with examples
  • Arrays.sort() in Java with examples
  • For-each loop in Java
  • Object Oriented Programming (OOPs) Concept in Java
  • Reverse a string in Java
  • HashMap in Java
  • How to iterate any Map in Java

Compound-assignment operators provide a shorter syntax for assigning the result of an arithmetic or bitwise operator. They perform the operation on the two operands before assigning the result to the first operand. The following are all possible assignment operator in java:

Implementation of all compound assignment operator

Rules for resolving the Compound assignment operators

At run time, the expression is evaluated in one of two ways.Depending upon the programming conditions:

  • First, the left-hand operand is evaluated to produce a variable. If this evaluation completes abruptly, then the assignment expression completes abruptly for the same reason; the right-hand operand is not evaluated and no assignment occurs.
  • Otherwise, the value of the left-hand operand is saved and then the right-hand operand is evaluated. If this evaluation completes abruptly, then the assignment expression completes abruptly for the same reason and no assignment occurs.
  • Otherwise, the saved value of the left-hand variable and the value of the right-hand operand are used to perform the binary operation indicated by the compound assignment operator. If this operation completes abruptly, then the assignment expression completes abruptly for the same reason and no assignment occurs.
  • Otherwise, the result of the binary operation is converted to the type of the left-hand variable, subjected to value set conversion to the appropriate standard value set, and the result of the conversion is stored into the variable.
  • First, the array reference sub-expression of the left-hand operand array access expression is evaluated. If this evaluation completes abruptly, then the assignment expression completes abruptly for the same reason; the index sub-expression (of the left-hand operand array access expression) and the right-hand operand are not evaluated and no assignment occurs.
  • Otherwise, the index sub-expression of the left-hand operand array access expression is evaluated. If this evaluation completes abruptly, then the assignment expression completes abruptly for the same reason and the right-hand operand is not evaluated and no assignment occurs.
  • Otherwise, if the value of the array reference sub-expression is null, then no assignment occurs and a NullPointerException is thrown.
  • Otherwise, the value of the array reference sub-expression indeed refers to an array. If the value of the index sub-expression is less than zero, or greater than or equal to the length of the array, then no assignment occurs and an ArrayIndexOutOfBoundsException is thrown.
  • Otherwise, the value of the index sub-expression is used to select a component of the array referred to by the value of the array reference sub-expression. The value of this component is saved and then the right-hand operand is evaluated. If this evaluation completes abruptly, then the assignment expression completes abruptly for the same reason and no assignment occurs.

Examples : Resolving the statements with Compound assignment operators

We all know that whenever we are assigning a bigger value to a smaller data type variable then we have to perform explicit type casting to get the result without any compile-time error. If we did not perform explicit type-casting then we will get compile time error. But in the case of compound assignment operators internally type-casting will be performed automatically, even we are assigning a bigger value to a smaller data-type variable but there may be a chance of loss of data information. The programmer will not responsible to perform explicit type-casting. Let’s see the below example to find the difference between normal assignment operator and compound assignment operator. A compound assignment expression of the form E1 op= E2 is equivalent to E1 = (T) ((E1) op (E2)), where T is the type of E1, except that E1 is evaluated only once.

For example, the following code is correct:

and results in x having the value 7 because it is equivalent to:

Because here 6.6 which is double is automatically converted to short type without explicit type-casting.

Refer: When is the Type-conversion required?

Explanation: In the above example, we are using normal assignment operator. Here we are assigning an int (b+1=20) value to byte variable (i.e. b) that’s results in compile time error. Here we have to do type-casting to get the result.

Explanation: In the above example, we are using compound assignment operator. Here we are assigning an int (b+1=20) value to byte variable (i.e. b) apart from that we get the result as 20 because In compound assignment operator type-casting is automatically done by compile. Here we don’t have to do type-casting to get the result.

Reference: http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.26.2

Please Login to comment...

Similar reads.

  • Java-Operators

advertisewithusBannerImg

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

C++ Primer, Fifth Edition by

Get full access to C++ Primer, Fifth Edition and 60K+ other titles, with a free 10-day trial of O'Reilly.

There are also live events, courses curated by job role, and more.

Compound Assignment Operators

We often apply an operator to an object and then assign the result to that same object. As an example, consider the sum program from § 1.4.2 (p. 13 ):

int sum = 0;// sum values from 1 through 10 inclusive for (int val = 1; val <= 10; ++val)    sum += val; //   equivalent to sum = sum + val

This kind of operation is common not just for addition but for the other arithmetic operators and the bitwise operators, which we cover in § 4.8 (p. 152 ). There are compound assignments for each of these operators:

 +=   -=   *=   /=   %=         // arithmetic operators <<=  >>=   &=   ^=   |=         // bitwise operators; see § 4.8 (p. 152 )

Each compound operator is essentially equivalent to

a = a op b;

with the exception that, when ...

Get C++ Primer, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Don’t leave empty-handed

Get Mark Richards’s Software Architecture Patterns ebook to better understand how to design components—and how they should interact.

It’s yours, free.

Cover of Software Architecture Patterns

Check it out now on O’Reilly

Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.

1.4.2 compound assignment operators quiz

Compound-Assignment Operators

  • Java Programming
  • PHP Programming
  • Javascript Programming
  • Delphi Programming
  • C & C++ Programming
  • Ruby Programming
  • Visual Basic
  • M.A., Advanced Information Systems, University of Glasgow

Compound-assignment operators provide a shorter syntax for assigning the result of an arithmetic or bitwise operator. They perform the operation on the two operands before assigning the result to the first operand.

Compound-Assignment Operators in Java

Java supports 11 compound-assignment operators:

Example Usage

To assign the result of an addition operation to a variable using the standard syntax:

But use a compound-assignment operator to effect the same outcome with the simpler syntax:

  • Conditional Operators
  • Java Expressions Introduced
  • Understanding the Concatenation of Strings in Java
  • The 7 Best Programming Languages to Learn for Beginners
  • Math Glossary: Mathematics Terms and Definitions
  • The Associative and Commutative Properties
  • The JavaScript Ternary Operator as a Shortcut for If/Else Statements
  • Parentheses, Braces, and Brackets in Math
  • Basic Guide to Creating Arrays in Ruby
  • Dividing Monomials in Basic Algebra
  • C++ Handling Ints and Floats
  • An Abbreviated JavaScript If Statement
  • Using the Switch Statement for Multiple Choices in Java
  • How to Make Deep Copies in Ruby
  • Definition of Variable
  • The History of Algebra

Compound assignment operators

The compound assignment operators consist of a binary operator and the simple assignment operator. They perform the operation of the binary operator on both operands and store the result of that operation into the left operand, which must be a modifiable lvalue.

The following table shows the operand types of compound assignment expressions:

Note that the expression

is equivalent to

The following table lists the compound assignment operators and shows an expression using each operator:

Although the equivalent expression column shows the left operands (from the example column) twice, it is in effect evaluated only once.

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications

(2024) Answers + Code to every quiz and assignment needed in the CodeHS course "Intro Into JavaScript"

aditeyapatakoti/CodeHS-IntroIntoJavascript

Folders and files, repository files navigation, codehs-introintojavascript.

This repository includes answers and code to every quiz and assignment needed in CodeHS's course called "Introduction to Computer Science in Javascript (Golden) 2022".

To find a specific assignment click on the Go to File button near the top of all of the files and then type in the assignment number.

Example: 19.2.3 (this will take you to the file named "Blinking Rectangles.js"

Quiz Answers Format

  • answer here
  • and so on...

If you find any issues with the code please let me know by creating an issue.

Click here to go to the issues page

Note: if you have any suggestions or want to add your own final projects to help out other people then please let me know through the discussion tab.

Sponsor this project

Contributors 2.

@aditeyapatakoti

  • JavaScript 100.0%

New Sandbox Program

Click on one of our programs below to get started coding in the sandbox!

1.4.2 compound assignment operators quiz

  • What is CodeHS?
  • Course Catalog
  • 6-12 Curriculum Pathway
  • All Courses
  • Hour of Code
  • Assignments
  • Classroom Management
  • Progress Tracking
  • Lesson Plans
  • Offline Handouts
  • Problem Guides
  • Problem Bank
  • Playlist Bank
  • Quiz Scores
  • Integrations
  • Google Classroom
  • Brightspace (D2L)
  • Professional Development
  • In-Person PD
  • Virtual PD Workshops
  • Certification Prep
  • Free PD Workshops
  • Testimonials
  • K-12 Framework
  • Common Core Math
  • State Standards
  • Scope and Sequence
  • Connecticut
  • Massachusetts
  • Mississippi
  • New Hampshire
  • North Carolina
  • North Dakota
  • Pennsylvania
  • Rhode Island
  • South Carolina
  • South Dakota
  • West Virginia
  • Bring to My School
  • Homeschools
  • Individual Learners

1.4.2 compound assignment operators quiz

AP Computer Science A (Nitro) - Outline

Primitive types, 1.1 why programming why java.

  • Video 1.1.1 Printing in Java
  • Check for Understanding 1.1.2 Printing in Java
  • Example 1.1.3 Hello World
  • Example 1.1.4 Printing Multiple Lines
  • Exercise 1.1.5 Welcome Program
  • Exercise 1.1.6 ASCII Art
  • Exercise 1.1.7 Fixing a Paragraph
  • Exercise 1.1.8 Heating Up
  • Exercise 1.1.9 Personal Timeline

1.2 Variables and Data Types

  • Video 1.2.1 Variables and Types
  • Check for Understanding 1.2.2 Variables and Types
  • Example 1.2.3 Variables
  • Example 1.2.4 Using Final
  • Exercise 1.2.5 Our First Integer
  • Video 1.2.6 Variables and Types Pt. 2
  • Check for Understanding 1.2.7 Variables and Types Pt. 2
  • Example 1.2.8 Swapping Two Values
  • Exercise 1.2.9 Answering Questions
  • Exercise 1.2.10 Team Rankings

1.3 Expressions and Assignment Statements

  • Video 1.3.1 Arithmetic Expressions
  • Check for Understanding 1.3.2 Arithmetic Expressions
  • Example 1.3.3 Calculator
  • Example 1.3.4 Temperature Conversion
  • Example 1.3.5 Tricky Java
  • Exercise 1.3.6 Weight of a Pyramid
  • Exercise 1.3.7 Add Fractions
  • Exercise 1.3.8 Freely Falling Bodies

1.4 Compound Assignment Operators

  • Video 1.4.1 Compound Assignment Operators
  • Check for Understanding 1.4.2 Compound Assignment Operators
  • Example 1.4.3 All Functions Calculator
  • Example 1.4.4 Increase/Decrease by 1
  • Exercise 1.4.5 Work Shift
  • Exercise 1.4.6 Personalized T-shirts

1.5 User Input

  • Video 1.5.1 User Input
  • Check for Understanding 1.5.2 User Input Quiz
  • Example 1.5.3 Using the Scanner Class
  • Example 1.5.4 Increase/Decrease by 1 (User Input)
  • Example 1.5.5 int Before String
  • Exercise 1.5.6 Personalized T-shirts (User Input)
  • Exercise 1.5.7 Night Out
  • Exercise 1.5.8 Test Score Calculator
  • Exercise 1.5.9 MLA Citation

1.6 Casting and Ranges of Variables

  • Video 1.6.1 Casting
  • Check for Understanding 1.6.2 Casting
  • Example 1.6.3 Casting
  • Exercise 1.6.4 Casting to an Int
  • Exercise 1.6.5 Casting to a Double
  • Example 1.6.6 Casting Order of Operations
  • Example 1.6.7 Rounding Using Casting
  • Exercise 1.6.8 Movie Ratings
  • Example 1.6.9 Implicit Casting
  • Example 1.6.10 Min and Max Values of Integers
  • Exercise 1.6.11 Integer Overflow

1.7 Primitive Types Quiz

  • Unit Quiz 1.7.1 Primitive Types Quiz

Using Objects

2.1 objects: instances of classes.

  • Video 2.1.1 Objects: Instances of Classes
  • Check for Understanding 2.1.2 Quiz: Classes and Objects
  • Video 2.1.3 Multi-File Exercises in Java
  • Example 2.1.4 Rectangle Skeleton
  • Example 2.1.5 GrilledCheese Skeleton
  • Example 2.1.6 Shark Skeleton
  • Free Response 2.1.7 Free Response: What instance variables?
  • Exercise 2.1.8 Pizza Instance Variables
  • Exercise 2.1.9 Game Skeleton

2.2 Creating and Storing Objects (Instantiation)

  • Video 2.2.1 Creating and Storing Objects
  • Check for Understanding 2.2.2 Quiz: Constructors
  • Example 2.2.3 The Rectangle Class
  • Example 2.2.4 The Point Class
  • Example 2.2.5 The Student Class
  • Exercise 2.2.6 Using the Rectangle Class
  • Exercise 2.2.7 New Student Field
  • Exercise 2.2.8 More Instance Variables
  • Exercise 2.2.9 Pizza Time!
  • Badge 2.2.10 Instantiation Badge

2.3 Overloading

  • Video 2.3.1 Method Overloading
  • Check for Understanding 2.3.2 Method Overloading Quiz
  • Example 2.3.3 Overloaded Rectangle
  • Example 2.3.4 Overloaded GrilledCheese
  • Example 2.3.5 Null Pointer Exception
  • Exercise 2.3.6 Plain Coffee
  • Exercise 2.3.7 Custom Piñatas
  • Exercise 2.3.8 Website Class
  • Exercise 2.3.9 Empty References

2.4 Calling a Void Method

  • Video 2.4.1 Calling a Void Method
  • Check for Understanding 2.4.2 Quiz: Void Methods
  • Example 2.4.3 Area of a Rectangle
  • Example 2.4.4 Program Flow
  • Exercise 2.4.5 Hello!
  • Exercise 2.4.6 Loose Change
  • Exercise 2.4.7 Chat Bot
  • Exercise 2.4.8 Greetings and Salutations

2.5 Calling a Void Method with Parameters

  • Video 2.5.1 Calling a Void Method with Parameters
  • Check for Understanding 2.5.2 Methods and Parameters
  • Example 2.5.3 Rectangle
  • Example 2.5.4 Moving a Point
  • Exercise 2.5.5 Using the Point Class
  • Example 2.5.6 Calculator
  • Exercise 2.5.7 Cricket Players
  • Exercise 2.5.8 More Operations
  • Exercise 2.5.9 Chat Bot 2.0

2.6 Calling a Non-void Method

  • Video 2.6.1 Calling a Non-void Method
  • Check for Understanding 2.6.2 Quiz: Non-Void Methods
  • Example 2.6.3 Rectangle
  • Example 2.6.4 Desks in a Room
  • Example 2.6.5 Activity Log
  • Exercise 2.6.6 Number Games
  • Exercise 2.6.7 Construction Costs
  • Exercise 2.6.8 How Far Away is ...?

2.7 String Objects

  • Video 2.7.1 String Objects
  • Check for Understanding 2.7.2 String Objects
  • Example 2.7.3 Immutable Strings
  • Example 2.7.4 String Concatenation
  • Example 2.7.5 Rectangle Dimensions
  • Example 2.7.6 Printing Equations
  • Exercise 2.7.7 Pretty Printing Operations
  • Exercise 2.7.8 Auto-fill
  • Exercise 2.7.9 QuoteMachine

2.8 String Methods

  • Video 2.8.1 String Methods
  • Check for Understanding 2.8.2 String Methods
  • Example 2.8.3 Bigger Strings?
  • Example 2.8.4 Chopping Strings
  • Example 2.8.5 Object Concatenation
  • Exercise 2.8.6 Speaking
  • Exercise 2.8.7 toString for Animals
  • Exercise 2.8.8 Organizing Class Roster
  • Exercise 2.8.9 Concatenating Fractions
  • Exercise 2.8.10 Word Games

2.9 Wrapper Classes: Integers and Doubles

  • Video 2.9.1 Wrapper Classes
  • Check for Understanding 2.9.2 Quiz: Wrapper Classes
  • Example 2.9.3 Creating Integers
  • Example 2.9.4 Using Doubles
  • Example 2.9.5 Autoboxing Example
  • Exercise 2.9.6 Order Up!
  • Exercise 2.9.7 Currency
  • Exercise 2.9.8 Guess the number!

2.10 Using the Math Class

  • Video 2.10.1 Using the Math Class
  • Check for Understanding 2.10.2 Quiz: Static Methods
  • Example 2.10.3 Using the Math Class
  • Example 2.10.4 Static Methods: Rectangle
  • Example 2.10.5 Generating Random Numbers
  • Exercise 2.10.6 Circle Area
  • Exercise 2.10.7 The Unit Circle
  • Exercise 2.10.8 Racing

2.11 Using Objects Quiz

  • Unit Quiz 2.11.1 Using Objects Quiz

Boolean Expressions and if Statements

3.1 boolean expressions and if statements.

  • Video 3.1.1 Comparison Operators
  • Check for Understanding 3.1.2 Comparison Operators
  • Example 3.1.3 Old Enough To Vote
  • Example 3.1.4 Grade Range
  • Example 3.1.5 Equality of Strings
  • Exercise 3.1.6 Meeting Goals
  • Exercise 3.1.7 Sugar Tax
  • Exercise 3.1.8 Triple Double

3.2 if Statements and Control Flow

  • Video 3.2.1 If Statements
  • Check for Understanding 3.2.2 If Statements
  • Example 3.2.3 Can Vote
  • Example 3.2.4 Negative Numbers
  • Example 3.2.5 Rectangle
  • Exercise 3.2.6 Discounts
  • Exercise 3.2.7 Sweet or Unsweet?
  • Exercise 3.2.8 Cooking
  • Exercise 3.2.9 Rating

3.3 if-else Statements

  • Video 3.3.1 If-Else Statements
  • Check for Understanding 3.3.2 If-Else
  • Example 3.3.3 Bill with add tip
  • Example 3.3.4 Even and Odd
  • Exercise 3.3.5 Running Speed
  • Exercise 3.3.6 Battleships Move
  • Exercise 3.3.7 Ratings
  • Exercise 3.3.8 Player Score

3.4 else if Statements

  • Video 3.4.1 else-if Statements
  • Check for Understanding 3.4.2 else-if
  • Example 3.4.3 Add Tip
  • Example 3.4.4 Add Tip - 8 or 4 Customers
  • Example 3.4.5 Add Tip - 8, 4, 2 Customers
  • Exercise 3.4.6 Positive, Negative, or Zero
  • Exercise 3.4.7 Salmon Spawn
  • Exercise 3.4.8 Berries
  • Exercise 3.4.9 Battleships

3.5 Compound Boolean Expressions

  • Video 3.5.1 Compound Boolean Expressions
  • Check for Understanding 3.5.2 Logical Operators
  • Example 3.5.3 Light Switch
  • Example 3.5.4 Number in Range
  • Example 3.5.5 Pizza Slices
  • Exercise 3.5.6 Roller Coaster
  • Exercise 3.5.7 Compound Roller Coaster
  • Exercise 3.5.8 Divisibility
  • Exercise 3.5.9 Find the Median

3.6 Equivalent Boolean Expressions

  • Video 3.6.1 Equivalent Boolean Expressions
  • Check for Understanding 3.6.2 De Morgan's Laws
  • Example 3.6.3 De Morgan AND
  • Example 3.6.4 De Morgan OR
  • Exercise 3.6.5 Amusement Park
  • Exercise 3.6.6 Negative Numbers
  • Exercise 3.6.7 Odd and Even
  • Free Response 3.6.8 Odd and Even Free Response

3.7 Comparing Objects

  • Video 3.7.1 Comparing Objects
  • Check for Understanding 3.7.2 Comparing Objects
  • Example 3.7.3 Comparing Strings
  • Example 3.7.4 Comparing Rectangles
  • Example 3.7.5 Null Test
  • Example 3.7.6 Identify Aliases
  • Exercise 3.7.7 String Variable Trace
  • Free Response 3.7.8 String Trace
  • Exercise 3.7.9 Three Strings
  • Exercise 3.7.10 Comparing Circles

3.8 Boolean Expressions and if Statements Quiz

  • Unit Quiz 3.8.1 Boolean Expressions and If Statements Quiz

4.1 Iteration

  • Video 4.1.1 While Loops
  • Check for Understanding 4.1.2 While Loops
  • Example 4.1.3 While Loop Countdown
  • Example 4.1.4 Get Down to One
  • Example 4.1.5 Running Average
  • Exercise 4.1.6 Making Taffy
  • Exercise 4.1.7 Guess the Number
  • Exercise 4.1.8 Divisibility
  • Exercise 4.1.9 Max and Min Values

4.2 For Loops

  • Video 4.2.1 For Loops
  • Check for Understanding 4.2.2 For Loops
  • Example 4.2.3 For Loop
  • Example 4.2.4 Countdown
  • Example 4.2.5 Count By Twos
  • Exercise 4.2.6 Print the Odds
  • Exercise 4.2.7 Repeat
  • Exercise 4.2.8 Replace WHILE with FOR Loop
  • Exercise 4.2.9 Replace FOR Loop with WHILE Loop
  • Exercise 4.2.10 Multiplication Table

4.3 Developing Algorithms Using Strings

  • Video 4.3.1 Developing Algorithms Using Strings
  • Check for Understanding 4.3.2 Developing Algorithms Using Strings
  • Example 4.3.3 Traversing Strings
  • Example 4.3.4 Replace Characters
  • Example 4.3.5 Reverse String
  • Exercise 4.3.6 Replace Letter
  • Exercise 4.3.7 Password Checker
  • Exercise 4.3.8 Finding Palindromes
  • Exercise 4.3.9 Fixing Grammar
  • Exercise 4.3.10 Teen Talk
  • Badge 4.3.11 String Processing Badge

4.4 Nested Iteration

  • Video 4.4.1 Nested Iteration
  • Check for Understanding 4.4.2 Nested Iteration
  • Example 4.4.3 Make a Rectangle
  • Example 4.4.4 Nested Loop Iteration Counts
  • Example 4.4.5 Inverted Triangle
  • Exercise 4.4.6 Upright Number Triangle
  • Exercise 4.4.7 Make a Tree
  • Exercise 4.4.8 Multiplication Table

4.5 Informal Code Analysis

  • Video 4.5.1 Informal Code Analysis
  • Check for Understanding 4.5.2 Informal Code Analysis
  • Example 4.5.3 Loop Execution Count
  • Example 4.5.4 While Loop Time
  • Example 4.5.5 For Loop Time
  • Free Response 4.5.6 Time Comparisons
  • Exercise 4.5.7 Improving findChar Speed
  • Example 4.5.8 Improving findChar Speed Check
  • Free Response 4.5.9 findChar Speed Reflection

4.6 Iteration Quiz

  • Unit Quiz 4.6.1 Iteration Quiz

Writing Classes

5.1 writing classes.

  • Video 5.1.1 Anatomy of Classes
  • Check for Understanding 5.1.2 Quiz: Access Modifiers
  • Example 5.1.3 Rectangle Getter Methods
  • Exercise 5.1.4 Access for DNA Class
  • Exercise 5.1.5 Access for Employee Class
  • Exercise 5.1.6 Fixing Circle

5.2 Constructors

  • Video 5.2.1 Constructors
  • Check for Understanding 5.2.2 Quiz: Constructors
  • Example 5.2.3 SuperHero Class
  • Example 5.2.4 Initializing an Object without a Constructor
  • Exercise 5.2.5 Batting Average
  • Exercise 5.2.6 Dog Class
  • Exercise 5.2.7 Student Overload
  • Exercise 5.2.8 SchoolClub Class

5.3 Documentation with Comments

  • Video 5.3.1 Documentation with Comments
  • Check for Understanding 5.3.2 Quiz: Comments
  • Example 5.3.3 Comments for Debugging
  • Example 5.3.4 Power Class with Comments
  • Exercise 5.3.5 Commenting Activity Tracker
  • Exercise 5.3.6 Commenting Activity Log
  • Exercise 5.3.7 C.Y.O.A. Layout
  • Exercise 5.3.8 C.Y.O.A. Finishing the story

5.4 Accessor Methods

  • Video 5.4.1 Accessor Methods
  • Check for Understanding 5.4.2 Quiz: Accessors
  • Example 5.4.3 Student Getter Methods
  • Example 5.4.4 SuperHero Class with Secret Identity
  • Exercise 5.4.5 Add Some Getter Methods
  • Exercise 5.4.6 Full Dragon Class
  • Exercise 5.4.7 A Different Dragon Class
  • Exercise 5.4.8 A Chef's Best Meal

5.5 Mutator Methods

  • Video 5.5.1 Mutator Methods
  • Check for Understanding 5.5.2 Quiz: Mutators
  • Example 5.5.3 SuperHero Class with Mutator Methods
  • Example 5.5.4 Student Setters
  • Exercise 5.5.5 Rectangle class
  • Exercise 5.5.6 Full Fraction Class
  • Exercise 5.5.7 Weekly Routine

5.6 Writing Methods

  • Video 5.6.1 Writing Methods
  • Check for Understanding 5.6.2 Quiz: Writing Methods
  • Example 5.6.3 Triangle Class
  • Example 5.6.4 Baseball Player Class
  • Exercise 5.6.5 Distance Conversions
  • Exercise 5.6.6 Food App Demo
  • Exercise 5.6.7 Car Class
  • Resource 5.6.8 Combination Lock FRQ

5.7 Static Variables and Methods

  • Video 5.7.1 Static Variables and Methods
  • Check for Understanding 5.7.2 Quiz: Static Methods
  • Example 5.7.3 Static SuperHero
  • Example 5.7.4 Static Variables: Circle
  • Exercise 5.7.5 Randomizer Class
  • Exercise 5.7.6 Rock, Paper, Scissors!
  • Exercise 5.7.7 In the Game?

5.8 Scope and Access

  • Video 5.8.1 Scope and Access
  • Check for Understanding 5.8.2 Quiz: Local Variables and Scope
  • Example 5.8.3 Instance Variable Scope
  • Example 5.8.4 Local Variable Scope
  • Example 5.8.5 Variable Shadowing
  • Example 5.8.6 Method Decomposition with Trivia
  • Exercise 5.8.7 Scope
  • Exercise 5.8.8 Which Variables Exist?
  • Exercise 5.8.9 Broken Calculator

5.9 this Keyword

  • Video 5.9.1 this Keyword
  • Check for Understanding 5.9.2 Quiz: this Keyword
  • Example 5.9.3 Rectangles and this
  • Example 5.9.4 Student and this
  • Exercise 5.9.5 Write Your Own CodeHS
  • Exercise 5.9.6 Song Class
  • Exercise 5.9.7 Fraction Math

5.10 Ethical and Social Implications of Computing

  • Video 5.10.1 Implications of Computing Systems
  • Free Response 5.10.2 Computing and Your Life
  • Check for Understanding 5.10.3 Quiz: Ethical and Social Impact
  • Connection 5.10.4 ACM General Ethical Principles
  • Free Response 5.10.5 ACM General Ethical Principles
  • Connection 5.10.6 Bias in Facial Recognition
  • Free Response 5.10.7 Bias in Facial Recognition
  • Connection 5.10.8 Self-driving Cars
  • Free Response 5.10.9 Self-driving Cars

5.11 Writing Classes Quiz

  • Unit Quiz 5.11.1 Writing Classes Quiz
  • Video 6.1.1 Introduction to Arrays
  • Check for Understanding 6.1.2 Quiz: Arrays
  • Example 6.1.3 Making an Array
  • Example 6.1.4 Make an Empty Array
  • Example 6.1.5 Indexing Into an Array
  • Exercise 6.1.6 Our First Array
  • Exercise 6.1.7 Set Scores
  • Exercise 6.1.8 Last Element in Array
  • Exercise 6.1.9 Snap Shot Splash Screen

6.2 Traversing Arrays

  • Video 6.2.1 Using Arrays
  • Check for Understanding 6.2.2 Quiz: Using Arrays
  • Example 6.2.3 Iterating Over An Array - For Loop
  • Example 6.2.4 Iterating Over An Array - While Loop
  • Example 6.2.5 Array Out of Bounds
  • Example 6.2.6 Finding a Target Value
  • Exercise 6.2.7 Print Array
  • Exercise 6.2.8 Print Odd Array Indices
  • Exercise 6.2.9 Find Index of a String
  • Exercise 6.2.10 Fibonacci Sequence

6.3 Enhanced for Loop for Arrays

  • Video 6.3.1 Enhanced For Loop for Arrays
  • Check for Understanding 6.3.2 Enhanced For Loop for Arrays
  • Example 6.3.3 Enhanced For Loop
  • Example 6.3.4 Classroom Array
  • Example 6.3.5 Updating Values in a Loop
  • Exercise 6.3.6 Print Odds
  • Exercise 6.3.7 Largest Value
  • Exercise 6.3.8 Classroom Array
  • Exercise 6.3.9 Array Average

6.4 Developing Algorithms Using Arrays

  • Video 6.4.1 Developing Algorithms Using Arrays
  • Check for Understanding 6.4.2 Developing Algorithms Using Arrays
  • Example 6.4.3 Finding the Minimum Value
  • Example 6.4.4 Reordering an Array
  • Example 6.4.5 Finding Duplicates
  • Exercise 6.4.6 Find the Median
  • Exercise 6.4.7 Find the Last Multiple of 3
  • Exercise 6.4.8 Most Improved
  • Challenge 6.4.9 Car Showroom

6.5 Array Quiz

  • Unit Quiz 6.5.1 Array Quiz

7.1 ArrayList

  • Video 7.1.1 ArrayLists
  • Check for Understanding 7.1.2 Quiz: ArrayList
  • Example 7.1.3 Initializing an ArrayList
  • Example 7.1.4 Array vs. ArrayList Initialization
  • Free Response 7.1.5 Arrays vs. ArrayLists
  • Exercise 7.1.6 Initializing an ArrayList
  • Exercise 7.1.7 Car Inventory

7.2 ArrayList Methods

  • Video 7.2.1 ArrayLists Methods
  • Check for Understanding 7.2.2 Quiz: ArrayList Methods
  • Example 7.2.3 ArrayList and Java Primitives
  • Example 7.2.4 ArrayList Methods
  • Example 7.2.5 Array vs. ArrayList Methods
  • Exercise 7.2.6 Get First Element
  • Exercise 7.2.7 ArrayList of Even Numbers
  • Exercise 7.2.8 Teacher Class List
  • Exercise 7.2.9 Teacher Class List Methods

7.3 Traversing ArrayLists

  • Video 7.3.1 Traversing ArrayLists
  • Check for Understanding 7.3.2 Quiz: Traversing Arrays
  • Example 7.3.3 Reading List
  • Example 7.3.4 While Loop ArrayList Traversal
  • Example 7.3.5 ArrayList Traversing Error
  • Exercise 7.3.6 Traversing Odds
  • Exercise 7.3.7 ArrayList Helper Methods
  • Exercise 7.3.8 Road Trip!

7.4 Developing Algorithms using ArrayLists

  • Video 7.4.1 Developing Algorithms Using ArrayLists
  • Check for Understanding 7.4.2 Quiz: Developing Algorithms
  • Example 7.4.3 Traversing ArrayLists Simultaneously
  • Example 7.4.4 Inserting Elements While Traversing ArrayLists
  • Exercise 7.4.5 ArrayList equals
  • Exercise 7.4.6 Airline Tickets
  • Exercise 7.4.7 Billboard Top 10
  • Exercise 7.4.8 User Data Cleanup

7.5 Searching

  • Video 7.5.1 Linear Search
  • Check for Understanding 7.5.2 Quiz: Linear Search
  • Example 7.5.3 Linear Search
  • Exercise 7.5.4 Linear Search on ArrayList with While Loop
  • Exercise 7.5.5 Fantasy Football Roster
  • Resource 7.5.6 Card Collection FRQ

7.6 Sorting

  • Video 7.6.1 Selection Sort
  • Check for Understanding 7.6.2 Selection Sort
  • Example 7.6.3 Selection Sort
  • Exercise 7.6.4 Explore Selection Sort
  • Video 7.6.5 Insertion Sort
  • Check for Understanding 7.6.6 Insertion Sort
  • Example 7.6.7 Insertion Sort
  • Example 7.6.8 Visualizing Algorithms
  • Exercise 7.6.9 Explore Insertion Sort
  • Example 7.6.10 Selection Sort vs. Insertion Sort Run Time
  • Free Response 7.6.11 Selection Sort vs. Insertion Sort
  • Exercise 7.6.12 Phonebook

7.7 Ethical Issues Around Data Collection

  • Video 7.7.1 Ethical Issues Around Data Collection
  • Check for Understanding 7.7.2 Ethical Issues Around Data Collection
  • Connection 7.7.3 The Curly Fry Conundrum
  • Free Response 7.7.4 Reflection
  • Connection 7.7.5 Guidelines on Ethical Data Use
  • Free Response 7.7.6 Issue News Article
  • Badge 7.7.7 ArrayList Badge

7.8 ArrayList Quiz

  • Unit Quiz 7.8.1 ArrayList Quiz

8.1 2D Arrays

  • Video 8.1.1 2D Arrays
  • Check for Understanding 8.1.2 Quiz: 2D Arrays
  • Example 8.1.3 GradeBook
  • Example 8.1.4 ChessBoard
  • Exercise 8.1.5 Manipulating 2D Arrays
  • Exercise 8.1.6 Complete Chessboard
  • Exercise 8.1.7 Tic Tac Toe Board

8.2 Traversing 2D Arrays

  • Video 8.2.1 Traversing 2D Arrays
  • Check for Understanding 8.2.2 Quiz: Traversing 2D Arrays
  • Example 8.2.3 Traversing Gradebook
  • Example 8.2.4 Linear Search 2D Arrays
  • Example 8.2.5 Row vs. Column Major
  • Free Response 8.2.6 Row vs. Column Major
  • Exercise 8.2.7 Sum Rows in a 2D Array
  • Exercise 8.2.8 Tic Tac Toe Methods
  • Challenge 8.2.9 Finalizing Tic Tac Toe
  • Badge 8.2.10 2D Array Badge

8.3 2D Array Quiz

  • Unit Quiz 8.3.1 2D Array Quiz

Inheritance

9.1 inheritance.

  • Video 9.1.1 Inheritance
  • Check for Understanding 9.1.2 Quiz: Subclasses and Superclasses
  • Example 9.1.3 Person Superclass
  • Example 9.1.4 Vehicle Superclass
  • Example 9.1.5 High School Student
  • Exercise 9.1.6 Person / Student Object
  • Exercise 9.1.7 Books
  • Exercise 9.1.8 Computers
  • Exercise 9.1.9 More Animals!

9.2 Writing Constructors for Subclasses

  • Video 9.2.1 Writing Constructors for Subclasses
  • Check for Understanding 9.2.2 Quiz: Writing Constructors for Subclasses
  • Example 9.2.3 Student Subclass
  • Example 9.2.4 Shape Class
  • Example 9.2.5 Implicit Call to Super
  • Exercise 9.2.6 Students
  • Exercise 9.2.7 Instruments
  • Exercise 9.2.8 Foods
  • Exercise 9.2.9 Clothing Store

9.3 Overriding Methods

  • Video 9.3.1 Overriding Methods
  • Check for Understanding 9.3.2 Quiz: Overriding Methods
  • Example 9.3.3 Square is a Rectangle
  • Example 9.3.4 Student toString
  • Example 9.3.5 Restaurant Bills
  • Exercise 9.3.6 Dogs Bark
  • Exercise 9.3.7 Electric Cars
  • Exercise 9.3.8 Online Companies

9.4 super Keyword

  • Video 9.4.1 super Keyword
  • Check for Understanding 9.4.2 Quiz: super Keyword
  • Example 9.4.3 Square Class
  • Example 9.4.4 Animal Class
  • Example 9.4.5 Apple Pie
  • Exercise 9.4.6 Squares
  • Exercise 9.4.7 Bank Accounts
  • Exercise 9.4.8 Employees
  • Exercise 9.4.9 Student Test Scores

9.5 Creating References Using Inheritance

  • Video 9.5.1 Creating References Using Inheritance Hierarchies
  • Check for Understanding 9.5.2 Quiz: References Using Inheritance Hierarchies
  • Example 9.5.3 Animal Sounds
  • Example 9.5.4 Shape Areas
  • Example 9.5.5 Person Class
  • Exercise 9.5.6 Pies
  • Exercise 9.5.7 Creating .equals
  • Exercise 9.5.8 Online Companies Revisited
  • Exercise 9.5.9 Assignments

9.6 Polymorphism

  • Video 9.6.1 Polymorphism
  • Check for Understanding 9.6.2 Quiz: Polymorphism
  • Example 9.6.3 Using Person Methods
  • Example 9.6.4 Modified Student Class
  • Example 9.6.5 Vehicle Methods
  • Exercise 9.6.6 Which Team?
  • Exercise 9.6.7 Cars
  • Exercise 9.6.8 Library Books
  • Exercise 9.6.9 Fun with Solids

9.7 Object Superclass

  • Video 9.7.1 Object Superclass
  • Check for Understanding 9.7.2 Quiz: Object Superclass
  • Example 9.7.3 Default Values
  • Example 9.7.4 Override toString
  • Example 9.7.5 Override equals
  • Exercise 9.7.6 Equal?
  • Exercise 9.7.7 Equals? - Part 2
  • Exercise 9.7.8 Equal Rectangles
  • Exercise 9.7.9 2D Array Tester

9.8 Inheritance Quiz

  • Unit Quiz 9.8.1 Inheritance Quiz

10.1 Recursion

  • Video 10.1.1 Recursion
  • Check for Understanding 10.1.2 Quiz: Recursion
  • Example 10.1.3 Summing
  • Example 10.1.4 Sum Array
  • Example 10.1.5 Fibonacci Recursion
  • Exercise 10.1.6 Factorial
  • Exercise 10.1.7 Countdown!
  • Exercise 10.1.8 Recursive Minimum
  • Exercise 10.1.9 Bacteria Cultures

10.2 Recursive Searching

  • Video 10.2.1 Recursive Searching
  • Check for Understanding 10.2.2 Quiz: Recursive Searching
  • Example 10.2.3 Binary Search
  • Example 10.2.4 Binary Recursive
  • Example 10.2.5 Binary vs Linear
  • Exercise 10.2.6 Exploring Binary Searches
  • Exercise 10.2.7 Comparing Binary Search and Linear Search
  • Exercise 10.2.8 Maximum Iterations

10.3 Recursive Sorting

  • Video 10.3.1 Recursive Sorting
  • Check for Understanding 10.3.2 Quiz: Recursive Sorting
  • Example 10.3.3 Merge Sort
  • Example 10.3.4 Sort Visualizer
  • Exercise 10.3.5 Explore Merge Sort
  • Exercise 10.3.6 Merge Sort Benchmark Testing
  • Exercise 10.3.7 Recursive Calls
  • Exercise 10.3.8 Sort Benchmark Testing

10.4 Recursion Quiz

  • Unit Quiz 10.4.1 Recursion Quiz

Recursion - Demo Unit

11.1 recursion.

  • Notes 11.1.1 Recursion
  • Check for Understanding 11.1.2 Quiz: Recursion
  • Example 11.1.3 Summing
  • Example 11.1.4 Sum Array
  • Exercise 11.1.5 Factorial
  • Exercise 11.1.6 Countdown!
  • Exercise 11.1.7 Recursive Minimum
  • Exercise 11.1.8 Bacteria Cultures
  • Article 11.1.9 Lesson Feedback

11.2 Recursive Searching

  • Video 11.2.1 Recursive Searching
  • Check for Understanding 11.2.2 Quiz: Recursive Searching
  • Example 11.2.3 Binary Search
  • Example 11.2.4 Binary Recursive
  • Example 11.2.5 Binary vs Linear
  • Exercise 11.2.6 Exploring Binary Searches
  • Exercise 11.2.7 Debug the Code: Linear Recursive Searches
  • Exercise 11.2.8 Comparing Binary Search and Linear Search
  • Article 11.2.9 Predict the Code: Binary Recursive Searches
  • Exercise 11.2.10 Maximum Iterations
  • Article 11.2.11 Lesson Feedback

11.3 Recursive Sorting

  • Video 11.3.1 Recursive Sorting
  • Check for Understanding 11.3.2 Quiz: Recursive Sorting
  • Example 11.3.3 Merge Sort
  • Example 11.3.4 Sort Visualizer
  • Exercise 11.3.5 Explore Merge Sort
  • Exercise 11.3.6 Merge Sort Benchmark Testing
  • Exercise 11.3.7 Recursive Calls
  • Exercise 11.3.8 Sort Benchmark Testing
  • Article 11.3.9 Lesson Feedback

11.4 Recursion Quiz

  • Unit Quiz 11.4.1 Recursion Quiz

Introduction to Programming in Java with Karel the Dog

12.1 introduction to programming with karel.

  • Video 12.1.1 Introduction to Programming With Karel
  • Check for Understanding 12.1.2 Quiz: Karel Commands
  • Example 12.1.3 Our First Karel Program
  • Exercise 12.1.4 Your First Karel Program
  • Exercise 12.1.5 Short Stack

12.2 More Basic Karel

  • Video 12.2.1 More Basic Karel
  • Check for Understanding 12.2.2 More Basic Karel
  • Example 12.2.3 Tennis Ball Square
  • Exercise 12.2.4 Make a Tower
  • Exercise 12.2.5 Pyramid of Karel

12.3 Java Programs and the Run Method

  • Video 12.3.1 Writing a Java Program
  • Check for Understanding 12.3.2 Run Method
  • Example 12.3.3 Square Karel
  • Exercise 12.3.4 Tower Karel
  • Exercise 12.3.5 Gold Medal Karel
  • Exercise 12.3.6 Maze Karel

12.4 Karel Can't Turn Right

  • Video 12.4.1 Karel Can't Turn Right
  • Check for Understanding 12.4.2 Karel Can't Turn Right
  • Example 12.4.3 Tower and Turn Right
  • Exercise 12.4.4 Slide Karel
  • Exercise 12.4.5 Fireman Karel
  • Badge 12.4.6 Right Turn Karel Badge

12.5 Methods in Karel

  • Video 12.5.1 Methods in Karel
  • Check for Understanding 12.5.2 Methods in Karel
  • Example 12.5.3 Turn Around
  • Exercise 12.5.4 Planting Bushes
  • Exercise 12.5.5 Mario Karel

12.6 Top Down Design and Decomposition in Karel

  • Video 12.6.1 Top Down Design and Decomposition in Karel
  • Check for Understanding 12.6.2 Top Down Design and Decomposition
  • Example 12.6.3 Hurdle Karel
  • Exercise 12.6.4 The Two Towers
  • Exercise 12.6.5 Planting Flowers

12.7 Commenting Your Code

  • Video 12.7.1 Commenting Your Code
  • Check for Understanding 12.7.2 Commenting Your Code
  • Example 12.7.3 Hurdle Karel (Comments)
  • Exercise 12.7.4 The Two Towers + Comments

12.8 Super Karel

  • Video 12.8.1 Super Karel
  • Check for Understanding 12.8.2 Super Karel
  • Example 12.8.3 Hurdle Karel (with SuperKarel)
  • Exercise 12.8.4 The Two Towers + SuperKarel
  • Badge 12.8.5 Super Karel Badge

12.9 For Loops

  • Video 12.9.1 For Loops
  • Check for Understanding 12.9.2 For Loops
  • Example 12.9.3 Repeated Move
  • Example 12.9.4 Put Down Tennis Balls
  • Exercise 12.9.5 Marathon Karel
  • Exercise 12.9.6 Take 'em All
  • Exercise 12.9.7 Dizzy Karel
  • Exercise 12.9.8 For Loop Square
  • Exercise 12.9.9 Planting Flowers
  • Exercise 12.9.10 Lots of Hurdles

12.10 While Loops in Karel

  • Video 12.10.1 While Loops in Karel
  • Check for Understanding 12.10.2 While Loops in Karel
  • Example 12.10.3 Move to Wall
  • Exercise 12.10.4 Follow The Yellow Ball Road
  • Exercise 12.10.5 Just Keep Spinning
  • Exercise 12.10.6 Lay Row of Tennis Balls
  • Exercise 12.10.7 Big Tower

12.11 If Statements

  • Video 12.11.1 If Statements
  • Check for Understanding 12.11.2 If Statements Quiz
  • Example 12.11.3 If Statements
  • Example 12.11.4 Safe Take Ball
  • Exercise 12.11.5 Is There a Ball?

12.12 If/Else Statements

  • Video 12.12.1 If/Else Statements
  • Check for Understanding 12.12.2 If/Else Statements
  • Example 12.12.3 Flip Karel
  • Exercise 12.12.4 Fix It Karel
  • Exercise 12.12.5 Invert
  • Badge 12.12.6 Conditional Karel Badge

12.13 Control Structures Example

  • Video 12.13.1 Control Structures Example
  • Check for Understanding 12.13.2 Control Structures Example
  • Example 12.13.3 Cleanup Karel
  • Exercise 12.13.4 Random Hurdles
  • Exercise 12.13.5 Fix It Karel

12.14 More Karel Examples and Testing

  • Video 12.14.1 More Karel Examples and Testing
  • Example 12.14.2 Move Tennis Ball Stack
  • Example 12.14.3 Climbing Karel

12.15 How to Indent Your Code

  • Video 12.15.1 How to Indent Your Code
  • Check for Understanding 12.15.2 How to Indent Your Code
  • Example 12.15.3 Dance and Clean Karel
  • Exercise 12.15.4 Diagonal
  • Exercise 12.15.5 Staircase
  • Badge 12.15.6 Karel Exercises Badge

12.16 Karel Challenges

  • Challenge 12.16.1 Fetch
  • Challenge 12.16.2 Racing Karel
  • Challenge 12.16.3 Tower Builder
  • Challenge 12.16.4 Super Cleanup Karel
  • Challenge 12.16.5 Double Tennis Balls
  • Challenge 12.16.6 Midpoint Karel
  • Badge 12.16.7 Karel Challenges Badge

12.17 Karel Quiz

  • Unit Quiz 12.17.1 Karel Quiz

AP Test Practice

13.1 ap practice test 1.

  • Final 13.1.1 Final AP Review
  • Practice 13.1.2 Free Response 1a
  • Practice 13.1.3 Free Response 1b
  • Practice 13.1.4 Free Response 2a
  • Practice 13.1.5 Free Response 2b
  • Practice 13.1.6 Free Response 3a
  • Exercise 13.1.7 Free Response 3b
  • Exercise 13.1.8 Free Response 4a
  • Exercise 13.1.9 Free Response 4b
  • Badge 13.1.10 AP Practice Test Badge

Java Pretest

14.1 java pretest.

  • Notes 14.1.1 About the Pretest
  • Survey 14.1.2 Mindsets
  • Quiz 14.1.3 Knowledge & Skills: Java

Java Posttest

15.1 java posttest.

  • Notes 15.1.1 About the Posttest
  • Survey 15.1.2 Mindsets
  • Quiz 15.1.3 Java Knowledge & Skills

Teacher Feedback

16.1 teacher feedback.

  • Resource 16.1.1 Feedback Survey

Additional Exercises

17.1 unit 3.

  • Example 17.1.1 Lesson 3.2 Air Hockey
  • Exercise 17.1.2 Lesson 3.2 Constructions
  • Exercise 17.1.3 Lesson 3.2 Game Bonus
  • Example 17.1.4 Lesson 3.3 Floating Point Error
  • Exercise 17.1.5 Lesson 3.3 Comparing Doubles
  • Exercise 17.1.6 Lesson 3.4 Classifying the Rich
  • Exercise 17.1.7 Lesson 3.4 Mesozoic Age
  • Challenge 17.1.8 Lesson 3.4 Dinosaurs
  • Exercise 17.1.9 Lesson 3.5 Salmon Season
  • Exercise 17.1.10 Lesson 3.6 Used Car
  • Example 17.1.11 Lesson 3.7 Changing Dogs
  • Example 17.1.12 Lesson 3.7 Creating Strings with New
  • Example 17.1.13 Lesson 3.7 Creating Strings with Literals

17.2 Unit 4

  • Exercise 17.2.1 Lesson 4.1 Find Digits
  • Exercise 17.2.2 Lesson 4.2 Factorial
  • Exercise 17.2.3 Lesson 4.2 Five Little Ducks
  • Exercise 17.2.4 Lesson 4.3 Fix the Sum
  • Example 17.2.5 Lesson 4.5 Values Held in Variables
  • Quiz 17.2.6 Lesson 4.5 Values Held in Variables
  • Exercise 17.2.7 Lesson 4.5 Values Held In Variables
  • Example 17.2.8 Lesson 4.5 Variable Trace
  • Free Response 17.2.9 Lesson 4.5 Variable Trace

17.3 Unit 5

  • Quiz 17.3.1 Lesson 5.10 Ethical Programmer Agreement
  • Presentation 17.3.2 Lesson 5.10 Explore a Software Application
  • Free Response 17.3.3 Lesson 5.10 Career Choice and Computing

17.4 Unit 7

  • Exercise 17.4.1 The Congo Company - Marketing Analysis
  • Free Response 17.4.2 The Congo Company - Strategy
  • Exercise 17.4.3 The Congo Company - Optimization

18.1 Elevens

  • Connection 18.1.1 Elevens Activity Guide
  • Exercise 18.1.2 Activity 1: Design and Create a Card Class
  • Exercise 18.1.3 Activity 2: Initial Design of a Deck Class
  • Free Response 18.1.4 Activity 2 Questions
  • Exercise 18.1.5 Activity 3: Shuffling the Cards in a Deck
  • Free Response 18.1.6 Activity 3 Questions
  • Exercise 18.1.7 Activity 4: Adding a Shuffle Method to the Deck
  • Demo 18.1.8 Activity 6: Playing Elevens
  • Free Response 18.1.9 Activity 6 Questions
  • Exercise 18.1.10 Activity 7: Elevens Board Class Design
  • Free Response 18.1.11 Activity 7 Questions
  • Exercise 18.1.12 Activity 8: Using an Abstract Board Class
  • Free Response 18.1.13 Activity 8 Questions
  • Exercise 18.1.14 Activity 9: Implementing the Elevens Board
  • Free Response 18.1.15 Activity 9 Questions

19.1 Magpie Lab

  • Connection 19.1.1 Magpie Student Guide
  • Free Response 19.1.2 Activity 1: Chatbots
  • Example 19.1.3 Activity 2: Introduction to Magpie
  • Exercise 19.1.4 Activity 2: Modifying Magpie
  • Free Response 19.1.5 Activity 2: Questions
  • Exercise 19.1.6 Activity 3: Improving Keyword Detection
  • Exercise 19.1.7 Activity 4: Responses that Transform Statements

Picture Lab

20.1 picture lab.

  • Resource 20.1.1 Introduction & Student Guide
  • Free Response 20.1.2 A1: Digital Pictures and Color
  • Example 20.1.3 A2: Picking a Color
  • Free Response 20.1.4 A2 Questions: Picking a Color
  • Example 20.1.5 A3: Exploring a Picture
  • Free Response 20.1.6 A3 Questions: Exploring a Picture
  • Exercise 20.1.7 A4: Two-Dimensional Arrays in Java
  • Free Response 20.1.8 A5: Interfaces
  • Exercise 20.1.9 A5: Modifying a Picture
  • Exercise 20.1.10 A6: Mirroring a Picture
  • Exercise 20.1.11 A9: Edge Detection

Consumer Review Lab

21.1 introduction.

  • Resource 21.1.1 Consumer Review Lab Activity Guide
  • Exercise 21.1.2 Review
  • Free Response 21.1.3 Review Free Response
  • Check for Understanding 21.1.4 Check For Understanding

21.2 Sentiment Value and Star Ratings

  • Exercise 21.2.1 Sentiment Value
  • Free Response 21.2.2 Sentiment Value Free Response

21.3 Autogenerated Review

  • Exercise 21.3.1 Autogenerate Review
  • Free Response 21.3.2 Autogenerate Review Free Response

21.4 Create a Negative or Positive Review

  • Exercise 21.4.1 Create a Negative or Positive Review
  • Free Response 21.4.2 Create a Negative or Positive Review

21.5 Open Ended Activity!

  • Exercise 21.5.1 Final Activity
  • Free Response 21.5.2 Wrap Up

Celebrity Lab

22.1 activity 1: introduction to celebrity.

  • Free Response 22.1.1 Introduction to Celebrity

22.2 Activity 2: The Celebrity Class: A Simple Version

  • Free Response 22.2.1 Celebrity Class: A Simple Version
  • Exercise 22.2.2 Celebrity Constructor

22.3 Activity 3: Putting it All Together

  • Exercise 22.3.1 Set up Constructors
  • Exercise 22.3.2 Setting up the Game
  • Exercise 22.3.3 Complete Game Play Methods
  • Free Response 22.3.4 Check Your Understanding

22.4 Activity 4: Extending the Celebrity Class

  • Free Response 22.4.1 Extending the Celebrity Class
  • Example 22.4.2 Literature Celebrity
  • Exercise 22.4.3 Custom Celebrity
  • Exercise 22.4.4 Updating CelebrityGame
  • Exercise 22.4.5 Updating the GUI

22.5 Activity 5: Open Ended Activity

  • Free Response 22.5.1 Open Ended Activity

Steganography Lab

23.1 activity 1: exploring color.

  • Resource 23.1.1 Steganography Student Lab
  • Free Response 23.1.2 Picture Lab A1: Digital Pictures and Color
  • Free Response 23.1.3 Exploring Color
  • Example 23.1.4 Clearing Bits
  • Free Response 23.1.5 Clearing Bits Responses
  • Exercise 23.1.6 Changing Colors
  • Free Response 23.1.7 Changing Colors Response
  • Exercise 23.1.8 Setting Bits

23.2 Activity 2: Hiding and Revealing a Picture

  • Free Response 23.2.1 Hiding and Revealing
  • Exercise 23.2.2 Hiding and Revealing

23.3 Activity 3: Identifying a Hidden Picture

  • Exercise 23.3.1 Identifying a Hidden Picture
  • Free Response 23.3.2 Identify a Hidden Picture: Check Your Understanding

23.4 Activity 4: Hiding and Revealing a Text Message

  • Free Response 23.4.1 Hiding and Revealing a Text Message Intro
  • Exercise 23.4.2 Hiding and Revealing a Text Message
  • Free Response 23.4.3 Hiding and Revealing; Check your Understanding

23.5 Activity 5: Open Ended Project

  • Exercise 23.5.1 Open Ended Project

Java Level 1 Certification Practice

24.1 practice #1: java fundamentals.

  • Quiz 24.1.1 Quiz: Java Fundamentals
  • Notes 24.1.2 Practice #1 Reflection

24.2 Practice #2: Data Types and Lists

  • Quiz 24.2.1 Quiz: Data Types and Lists
  • Notes 24.2.2 Practice #2 Reflection

24.3 Practice #3: Implementing Flow Control

  • Quiz 24.3.1 Quiz: Implementing Flow Control
  • Notes 24.3.2 Practice #3 Reflection

24.4 Practice #4: OOP and Other Advanced Topics

  • Quiz 24.4.1 Quiz: OOP and Other Advanced Topics
  • Notes 24.4.2 Practice #4 Reflection

Deprecated Activities 08/25/21

25.1 deprecated activities 08/25/21.

  • Exercise 25.1.1 Welcome Program
  • Exercise 25.1.2 ASCII Art
  • Exercise 25.1.3 Heating Up
  • Exercise 25.1.4 Answering Questions
  • Exercise 25.1.5 Freely Falling Bodies
  • Exercise 25.1.6 My Age
  • Exercise 25.1.7 My Age (User Input)
  • Exercise 25.1.8 Night Out
  • Exercise 25.1.9 Casting to an Int
  • Free Response 25.1.10 Phone Skeleton
  • Exercise 25.1.11 Student GPA Field
  • Exercise 25.1.12 Instance Variables for Your Dog
  • Exercise 25.1.13 Plain Coffee
  • Exercise 25.1.14 Empty References
  • Exercise 25.1.15 Loose Change
  • Exercise 25.1.16 Chat Bot
  • Exercise 25.1.17 Basketball Players
  • Exercise 25.1.18 Chat Bot 2.0
  • Exercise 25.1.19 Number Games
  • Exercise 25.1.20 Full Name
  • Exercise 25.1.21 Speaking
  • Exercise 25.1.22 toString for Flowers
  • Exercise 25.1.23 Organizing Files
  • Exercise 25.1.24 Guess the number!
  • Exercise 25.1.25 Circle Area
  • Exercise 25.1.26 Number Order
  • Exercise 25.1.27 Discounts
  • Exercise 25.1.28 Cooking
  • Exercise 25.1.29 Positive or Negative
  • Exercise 25.1.30 Battleships Move
  • Exercise 25.1.31 Berries
  • Exercise 25.1.32 Battleships
  • Exercise 25.1.33 Find the Minimum
  • Exercise 25.1.34 Odd Numbers
  • Exercise 25.1.35 Three Strings
  • Exercise 25.1.36 Guess the Number
  • Exercise 25.1.37 Max and Min Values
  • Exercise 25.1.38 Repeat 100 Times
  • Exercise 25.1.39 Replace FOR Loop with WHILE Loop
  • Exercise 25.1.40 Replace Letter
  • Exercise 25.1.41 Teen Talk
  • Exercise 25.1.42 Make a Tree
  • Exercise 25.1.43 Access for Employee Class
  • Exercise 25.1.44 Dog Class
  • Exercise 25.1.45 C.Y.O.A. Layout
  • Exercise 25.1.46 C.Y.O.A. Finishing the story
  • Exercise 25.1.47 Text Messages Getter Methods
  • Exercise 25.1.48 A Chef's Best Meal
  • Exercise 25.1.49 Weekly Routine
  • Exercise 25.1.50 Distance Conversions
  • Exercise 25.1.51 How Many Players in the Game?
  • Exercise 25.1.52 Scope
  • Exercise 25.1.53 Write Your Own CodeHS
  • Exercise 25.1.54 Our First Array
  • Exercise 25.1.55 Last Element in Array
  • Exercise 25.1.56 Print Array
  • Exercise 25.1.57 Fibonacci Sequence
  • Exercise 25.1.58 Classroom Array
  • Exercise 25.1.59 Find the Last Multiple of 3
  • Exercise 25.1.60 Most Improved
  • Exercise 25.1.61 Car Inventory
  • Exercise 25.1.62 Get First Element
  • Exercise 25.1.63 ArrayList of Even Numbers
  • Exercise 25.1.64 ArrayList Helper Methods
  • Exercise 25.1.65 User Data Cleanup
  • Exercise 25.1.66 Fantasy Football Roster
  • Exercise 25.1.67 Phonebook
  • Exercise 25.1.68 Manipulating 2D Arrays
  • Exercise 25.1.69 Sum Rows in a 2D Array
  • Exercise 25.1.70 Person / Student Object
  • Exercise 25.1.71 Books
  • Exercise 25.1.72 Students
  • Exercise 25.1.73 Foods
  • Exercise 25.1.74 Electric Cars
  • Exercise 25.1.75 Squares
  • Exercise 25.1.76 Bank Accounts
  • Exercise 25.1.77 Pies
  • Exercise 25.1.78 Assignments
  • Exercise 25.1.79 Cars
  • Exercise 25.1.80 Library Books
  • Exercise 25.1.81 Equal?
  • Exercise 25.1.82 Equals? - Part 2
  • Exercise 25.1.83 Countdown!
  • Exercise 25.1.84 Bacteria Cultures
  • Exercise 25.1.85 Exploring Binary Searches
  • Exercise 25.1.86 Explore Merge Sort
  • Exercise 25.1.87 Recursive Calls

Sign up for a free teacher account to get access to curriculum, teacher tools and teacher resources.

Sign up as a student if you are in a school and have a class code given to you by your teacher.

Interested in teaching with CodeHS? Get in touch, so we can help you bring CodeHS to your school!

1.4.2 compound assignment operators quiz

  • Introduction to Python
  • Download and Install Python
  • The First Python Program in IDLE
  • Data Types in Python
  • Python Keywords and Identifiers
  • Python Variables and Constants
  • Python If Statement
  • Python If Else Statement
  • Python Elif Statement
  • Python Nested If Statement
  • Python Nested If Else Statement
  • Python While Loop
  • Python For Loop
  • Python Break Statement
  • Python Arithmetic Operators
  • Python Compound Assignment Operators
  • Python Relational Operators
  • Python Logical Operators
  • Python Conditional Operator
  • Python Classes
  • Python Constructors
  • Python Static Variable
  • Python Static Method
  • Python Class Method
  • Python Inheritance
  • Python Super() Function
  • Python Method Overriding
  • Python Polymorphism
  • Python Garbage Collection
  • Python Array from Array Module
  • Python Array from Numpy Module
  • Python two-dimensional Array
  • Python Exception Handling
  • Python Exception Propagation
  • Python Try, Except Block
  • Python Multiple Except Block
  • Python Try, Except, Else Block
  • Python Finally Block
  • Python Raise Keyword
  • Python User-Defined Exception
  • Python Functions
  • Python Functions with Arguments
  • Python Functions with Default Arguments
  • Python Recursive Function
  • Python Local Variables
  • Python Global Variables
  • Python Tuple
  • Python List
  • Python Dictionary
  • Python - String
  • Python - String Methods
  • Python - String capitalize() Method
  • Python - String upper() Method
  • Python - String isupper() Method
  • Python - String casefold() Method
  • Python - String lower() Method
  • Python - String islower() Method
  • Python - String swapcase() Method
  • Python - String title() Method
  • Python - String istitle() Method
  • Python - String strip() Method
  • Python - String lstrip() Method
  • Python - String rstrip() Method
  • Python - String isnumeric() Method
  • Python - String isdigit() Method
  • Python - String isalpha() Method
  • Python - String isalnum() Method
  • Python - String isdecimal() Method
  • Python - String isidentifier() Method
  • Python - String isprintable() Method
  • Python - String startswith() Method
  • Python - String endswith() Method
  • Python - String index() Method
  • Python - String find() Method
  • Python - String rfind() Method
  • Python - String rindex() Method
  • Python - String center() Method
  • Python - String rjust() Method
  • Python - String ljust() Method
  • Python - String replace() Method
  • Python - String count() Method
  • Python - String split() Method
  • Python - String rsplit() Method
  • Python - String splitlines() Method
  • Python - String partition() Method
  • Python - String rpartition() Method
  • Python - String zfill() Method
  • Python - String Formatting
  • Python - Input/Output Functions
  • Python - File and File Modes
  • Python - Read a File
  • Python - Write a File
  • Python - Append to a File
  • Python - Modify a File

Advertisement

+= operator

  • First, an add operation.
  • Next, the assignment of the result of an add operation.
  • Statement i+=2 is equal to i=i+2 , hence 2 will be added to the value of i, which gives us 4.
  • Finally, the result of addition, 4 is assigned back to i, updating its original value from 2 to 4.

A special case scenario for all the compound assigned operators

Example with += operator, -= operator.

  • Subtraction operation.
  • Assignment of the result of a subtract operation.
  • Statement i-=2 is equal to i=i-2 , hence 2 will be subtracted from the value of i, which gives us 0.
  • Finally, the result of subtraction i.e. 0 is assigned back to i, updating its value to 0.

Example with -= operator

*= operator.

  • Multiplication operation.
  • Assignment of the result of a multiplication operation.
  • Statement i*=2 is equal to i=i*2 , hence 2 will be multiplied with the value of i, which gives us 4.
  • Finally, the result of multiplication, 4 is assigned back to i, updating its value to 4.

Example with *= operator

/= operator.

  • floating-point division operation.
  • Assignment of the result of floating-point division operation.
  • Statement i/=2 is equal to i=i/2 , hence 4 will be divided by the value of i, which gives us 2.0
  • Finally, the result of division i.e. 2.0 is assigned back to i, updating its value from 4 to 2.0.

Example with /= operator

//= operator.

  • Integer division operation, which gives us an integer quotient value after dividing two integers and it gives a floating-point quotient after dividing a floating-point number with an integer value or vice versa.
  • Assignment of the result of an integer division operation.
  • Statement i/=2 is equal to i=i//2 , hence 4 will be divided by the value of i, which gives us 2.
  • Finally, the result of division i.e. 2 is assigned back to i, updating its value from 4 to 2.

Example with //= operator

Please share this article -.

Facebook

Please Subscribe

Decodejava Facebook Page

Notifications

Please check our latest addition C#, PYTHON and DJANGO

1.4.2 compound assignment operators quiz

  • Table of Contents
  • Course Home
  • Assignments
  • Peer Instruction (Instructor)
  • Peer Instruction (Student)
  • Change Course
  • Instructor's Page
  • Progress Page
  • Edit Profile
  • Change Password
  • Scratch ActiveCode
  • Scratch Activecode
  • Instructors Guide
  • About Runestone
  • Report A Problem
  • This Chapter
  • 1. Getting Started and Primitive Types' data-toggle="tooltip" >

Before you keep reading...

Runestone Academy can only continue if we get support from individuals like you. As a student you are well aware of the high cost of textbooks. Our mission is to provide great books to you for free, but we ask that you consider a $10 donation, more if you can or less if $10 is a burden.

Making great stuff takes time and $$. If you appreciate the book you are reading now and want to keep quality materials free for other students please consider a donation to Runestone Academy. We ask that you consider a $10 donation, but if you can give more thats great, if $10 is too much for your budget we would be happy with whatever you can afford as a show of support.

_images/CSAwesomeLogo.png

AP CSA Java Course ¶

Welcome to CSAwesome! It’s time to start your journey to learn how to program with Java. A shortcut way to get to this site is to type in the url: course.csawesome.org

CSAwesome is a College Board endorsed curriculum for AP Computer Science A, an introductory college-level computer programming course in Java. If you are a teacher using this curriculum, please join the teaching CSAwesome group which will give you access to teacher resources at csawesome.org .

To make sure the site saves your answers on questions, please click on the person icon at the top to register or login to your Runestone course. As you complete lessons, click the “Mark as completed” button at the bottom. Enjoy the journey!

ATTENTION high school women of color taking AP CSA or CSP: if you identify as female and as Black, Hispanic/Latina, and/or Native American, apply to participate in Sisters Rise Up . The goal of Sisters Rise Up is to help you succeed in your AP Computer Science course and on the exam. They offer one-hour help sessions several times a week and once a month special help sessions often with guest speakers from computing. If you enroll in Sisters Rise Up and send in your AP CS exam score by the end of August, you will be sent a gift card for $100. See the flyer and apply at https://tinyurl.com/55z7tyb9 .

CSAwesome Units:

Table of Contents ¶

  • 1.1.1. Preface
  • 1.1.2. About the AP CSA Exam
  • 1.1.3. Transitioning from AP CSP to AP CSA
  • 1.1.4. Java Development Environments
  • 1.1.5. Growth Mindset and Pair Programming
  • 1.1.6. Pretest for the AP CSA Exam
  • 1.1.7. Survey
  • 1.2.1. First Java Program
  • 1.2.2. Print Methods
  • 1.2.3. Syntax Errors and Debugging
  • 1.2.4. Reading Error Messages
  • 1.2.5. Comments
  • 1.2.6. Debugging Challenge
  • 1.2.7. Summary
  • 1.2.8. AP Practice
  • 1.3.1. What is a Variable?
  • 1.3.2. Data Types
  • 1.3.3. Declaring Variables in Java
  • 1.3.4. Naming Variables
  • 1.3.5. Debugging Challenge : Weather Report
  • 1.3.6. Summary
  • 1.3.7. AP Practice
  • 1.4.1. Assignment Statements
  • 1.4.2. Adding 1 to a Variable
  • 1.4.3. Input with Variables
  • 1.4.4. Operators
  • 1.4.5. The Remainder Operator
  • 1.4.6. Programming Challenge : Dog Years
  • 1.4.7. Summary
  • 1.4.8. AP Practice
  • 1.5.1. Code Tracing Challenge and Operators Maze
  • 1.5.2. Summary
  • 1.6.1. Programming Challenge : Average 3 Numbers
  • 1.6.2. Bonus Challenge : Unicode
  • 1.6.3. Summary
  • 1.7.1. Concept Summary
  • 1.7.2. Java Keyword Summary
  • 1.7.3. Vocabulary Practice
  • 1.7.4. Common Mistakes
  • 1.8. Mixed Up Code Practice
  • 1.9. Toggle Mixed Up or Write Code Practice
  • 1.10. Coding Practice
  • 1.11. Multiple Choice Exercises
  • 2.1.1. What are Objects and Classes?
  • 2.1.2. Intro to Objects with Turtles
  • 2.1.3. Creating Turtle Objects
  • 2.1.4. Programming Challenge : Turtle Drawing
  • 2.1.5. Summary
  • 2.1.6. AP Practice
  • 2.2.1. Overloading Constructors
  • 2.2.2. The World Class Constructors
  • 2.2.3. The Turtle Class Constructors
  • 2.2.4. Object Variables and References
  • 2.2.5. Constructor Signatures
  • 2.2.6. Formal and Actual Parameters
  • 2.2.7. Programming Challenge: Custom Turtles
  • 2.2.8. Summary
  • 2.2.9. AP Practice
  • 2.3.1. Procedural Abstraction
  • 2.3.2. Programming Challenge : Draw a Letter
  • 2.3.3. Summary
  • 2.3.4. AP Practice
  • 2.4.1. Tracing Methods
  • 2.4.2. Programming Challenge : Turtle House
  • 2.4.3. Summary
  • 2.4.4. AP Practice
  • 2.5.1. Accessors / Getters
  • 2.5.2. Methods with Arguments and a Return Value
  • 2.5.3. Programming Challenge : Turtle Distances
  • 2.5.4. Summary
  • 2.5.5. AP Practice
  • 2.6.1. String Operators - Concatenation
  • 2.6.2. Programming Challenge : Mad Libs
  • 2.6.3. Summary
  • 2.7.1. String Methods: length, substring, indexOf
  • 2.7.2. CompareTo and Equals
  • 2.7.3. Common Mistakes with Strings
  • 2.7.4. Programming Challenge : Pig Latin
  • 2.7.5. Summary
  • 2.7.6. String Methods Game
  • 2.8.1. Programming Challenge : Debugging
  • 2.8.2. Summary
  • 2.9.1. Mathematical Functions
  • 2.9.2. Random Numbers
  • 2.9.3. Programming Challenge : Random Numbers
  • 2.9.4. Summary
  • 2.10.1. Concept Summary
  • 2.10.2. Java Keyword Summary
  • 2.10.3. Vocabulary Practice
  • 2.10.4. Common Mistakes
  • 2.11. Mixed Up Code Practice
  • 2.12. Toggle Mixed Up or Write Code Practice
  • 2.13. Coding Practice
  • 2.14. Practice Test for Objects (2.1-2.5)
  • 2.15.1. Easier Multiple Choice Questions
  • 2.15.2. Medium Multiple Choice Questions
  • 2.15.3. Hard Multiple Choice Questions
  • 2.16. Java Swing GUIs (optional)
  • 3.1.1. Testing Equality (==)
  • 3.1.2. Relational Operators (<, >)
  • 3.1.3. Testing with remainder (%)
  • 3.1.4. Programming Challenge : Prime Numbers POGIL
  • 3.1.5. Summary
  • 3.1.6. AP Practice
  • 3.1.7. Relational Operators Practice Game
  • 3.2.1. Relational Operators in If Statements
  • 3.2.2. Common Errors with If Statements
  • 3.2.3. Programming Challenge : Magic 8 Ball
  • 3.2.4. Summary
  • 3.2.5. AP Practice
  • 3.3.1. Nested Ifs and Dangling Else
  • 3.3.2. Programming Challenge : 20 Questions
  • 3.3.3. Summary
  • 3.3.4. AP Practice
  • 3.4.1. Programming Challenge : Adventure
  • 3.4.2. Summary
  • 3.4.3. AP Practice
  • 3.5.1. And (&&), Or (||), and Not (!)
  • 3.5.2. Truth Tables
  • 3.5.3. Short Circuit Evaluation
  • 3.5.4. Programming Challenge : Truth Tables POGIL
  • 3.5.5. Summary
  • 3.5.6. AP Practice
  • 3.5.7. Boolean Game
  • 3.6.1. De Morgan’s Laws
  • 3.6.2. Truth Tables
  • 3.6.3. Simplifying Boolean Expressions
  • 3.6.4. Programming Challenge : Truth Tables POGIL
  • 3.6.5. Summary
  • 3.6.6. AP Practice
  • 3.7.1. String Equality
  • 3.7.2. Equality with New Strings
  • 3.7.3. Comparing with null
  • 3.7.4. Programming Challenge : Tracing Code
  • 3.7.5. Summary
  • 3.7.6. AP Practice
  • 3.8.1. Concept Summary
  • 3.8.2. Java Keyword Summary
  • 3.8.3. Vocabulary Practice
  • 3.8.4. Common Mistakes
  • 3.9. Mixed Up Code Practice
  • 3.10. Toggle Mixed Up or Write Code Practice
  • 3.11. Coding Practice
  • 3.12.1. Easier Multiple Choice Questions
  • 3.12.2. Medium Multiple Choice Questions
  • 3.12.3. Hard Multiple Choice Questions
  • 3.13.1. Magpie ChatBot Lab
  • 3.13.2. Activity 2: Running Simplified Magpie Code
  • 3.13.3. Activity 3: Better Keyword Detection
  • 3.13.4. Activity 4: Responses that Transform Statements
  • 3.13.5. Mixed Up Code Practice
  • 3.14. More Coding Practice
  • 4.1.1. Three Steps to Writing a Loop
  • 4.1.2. Tracing Loops
  • 4.1.3. Common Errors with Loops
  • 4.1.4. Input-Controlled Loops
  • 4.1.5. Programming Challenge : Guessing Game
  • 4.1.6. Summary
  • 4.1.7. AP Practice
  • 4.2.1. Three Parts of a For Loop
  • 4.2.2. Decrementing Loops
  • 4.2.3. Turtle Loops
  • 4.2.4. Programming Challenge : Turtles Drawing Shapes
  • 4.2.5. Summary
  • 4.2.6. AP Practice
  • 4.3.1. While Find and Replace Loop
  • 4.3.2. For Loops: Reverse String
  • 4.3.3. Programming Challenge : String Replacement Cats and Dogs
  • 4.3.4. Summary
  • 4.4.1. Nested Loops with Turtles
  • 4.4.2. Programming Challenge : Turtle Snowflakes
  • 4.4.3. Summary
  • 4.5.1. Tracing Loops
  • 4.5.2. Counting Loop Iterations
  • 4.5.3. Programming Challenge : POGIL Analyzing Loops
  • 4.5.4. Summary
  • 4.5.5. Loop Analysis Game
  • 4.6.1. Concept Summary
  • 4.6.2. Java Keyword Summary
  • 4.6.3. Vocabulary Practice
  • 4.6.4. Common Mistakes
  • 4.7.1. Going Beyond Remainder 4
  • 4.7.2. Look Deeper
  • 4.7.3. More Practice
  • 4.7.4. Long Division with a Remainder
  • 4.7.5. Dividing Evenly
  • 4.7.6. Describe the Remainder (%) Operator
  • 4.8. Mixed Up Code Practice
  • 4.9. Toggle Mixed Up or Write Code Practice
  • 4.10. Coding Practice with Loops
  • 4.11.1. Easier Multiple Choice Questions
  • 4.11.2. Medium Multiple Choice Questions
  • 4.11.3. More Practice
  • 4.12.1. 2019 APCalendar FRQ
  • 4.12.2. Part A: numberOfLeapYear()
  • 4.12.3. How to solve numberOfLeapYears()
  • 4.12.4. Part B: dayOfWeek()
  • 4.13.1. How to solve this problem
  • 4.13.2. Video - One way to code the solution
  • 4.14.1. How to solve this problem
  • 4.14.2. Figuring out the algorithm
  • 4.14.3. Write the Code
  • 4.14.4. Video - One way to code the solution
  • 4.15.1. Activity 0 Analyzing Reviews
  • 4.15.2. Activity 1 : Sentiment Value
  • 4.15.3. Activity 2 :Total Sentiment Value and Star Ratings
  • 4.15.4. Activity 3 : Autogenerate a Fake Review
  • 4.15.5. Activity 4 : Create a More Positive or Negative Review
  • 4.15.6. Activity 5 : Open-ended Activity
  • 5.1.1. Creating a Class
  • 5.1.2. Designing a Class
  • 5.1.3. Instance Variables
  • 5.1.4. Methods
  • 5.1.5. Object-Oriented Design
  • 5.1.6. Programming Challenge : Riddle Class
  • 5.1.7. Design a Class for your Community
  • 5.1.8. Summary
  • 5.1.9. AP Practice
  • 5.2.1. Constructor Signature
  • 5.2.2. The Job of a Constructor
  • 5.2.3. Advanced AP Topic: Reference parameters
  • 5.2.4. Programming Challenge : Student Class
  • 5.2.5. Design a Class for your Community
  • 5.2.6. Summary
  • 5.2.7. AP Practice
  • 5.3.1. Comments
  • 5.3.2. Preconditions and Postconditions
  • 5.3.3. Software Validity and Use-Case Diagrams
  • 5.3.4. Agile Software Development
  • 5.3.5. Programming Challenge : Comments and Conditions
  • 5.3.6. Summary
  • 5.4.1. toString
  • 5.4.2. Programming Challenge : Class Pet
  • 5.4.3. Summary
  • 5.4.4. AP Practice
  • 5.5.1. How to write a setter
  • 5.5.2. Programming Challenge : Class Pet Setters
  • 5.5.3. Summary
  • 5.5.4. AP Practice
  • 5.6.1. Parameters
  • 5.6.2. Programming Challenge : Song with Parameters
  • 5.6.3. Design a Class for your Community
  • 5.6.4. Summary
  • 5.6.5. AP Practice
  • 5.7.1. Programming Challenge : Static Song and counter
  • 5.7.2. Summary
  • 5.8.1. Programming Challenge : Debugging
  • 5.8.2. Summary
  • 5.8.3. AP Practice
  • 5.9.1. Programming Challenge : Bank Account
  • 5.9.2. Summary
  • 5.9.3. AP Practice
  • 5.10.1. POGIL Groupwork: Impacts of CS
  • 5.10.2. Summary
  • 5.11.1. Concept Summary
  • 5.11.2. Java Keyword Summary
  • 5.11.3. Vocabulary Practice
  • 5.11.4. Common Mistakes
  • 5.12. Mixed Up Code Practice
  • 5.13. Toggle Mixed Up or Write Code Practice
  • 5.14. Multiple-Choice Exercises
  • 5.15. Midterm Test
  • 5.16.1. 2019 StepTracker Class FRQ
  • 5.16.2. Determining the Instance Variables
  • 5.16.3. Writing the Class Header and Constructor
  • 5.16.4. Writing the Accessor Method activeDays
  • 5.16.5. Writing the Mutator Method addDailySteps
  • 5.16.6. Writing the Accessor Method averageSteps
  • 5.17. Free Response Question - Time
  • 5.18.1. Try and Solve It
  • 5.19. College Board Celebrity and Data Labs
  • 5.20.1. Code your Class
  • 5.20.2. Optional Swing GUI
  • 6.1.1. Declaring and Creating an Array
  • 6.1.2. Using new to Create Arrays
  • 6.1.3. Initializer Lists to Create Arrays
  • 6.1.4. Array length
  • 6.1.5. Access and Modify Array Values
  • 6.1.6. Programming Challenge : Countries Array
  • 6.1.7. Design an Array of Objects for your Community
  • 6.1.8. Summary
  • 6.1.9. AP Practice
  • 6.1.10. Arrays Game
  • 6.2.1. Index Variables
  • 6.2.2. For Loop to Traverse Arrays
  • 6.2.3. Looping From Back to Front
  • 6.2.4. Looping through Part of an Array
  • 6.2.5. Common Errors When Looping Through an Array
  • 6.2.6. Programming Challenge : SpellChecker
  • 6.2.7. Design an Array of Objects for your Community
  • 6.2.8. Summary
  • 6.2.9. Arrays Game
  • 6.3.1. Foreach Loop Limitations
  • 6.3.2. Foreach Loop Algorithms
  • 6.3.3. Programming Challenge : SpellChecker 2
  • 6.3.4. Design an Array of Objects for your Community
  • 6.3.5. Summary
  • 6.4.1. Free Response - Horse Barn A
  • 6.4.2. Free Response - Horse Barn B
  • 6.4.3. Free Response - Self Divisor B
  • 6.4.4. Free Response - Sound A
  • 6.4.5. Free Response - Sound B
  • 6.4.6. Free Response - Number Cube A
  • 6.4.7. Free Response - Number Cube B
  • 6.5.1. Concept Summary
  • 6.5.2. Java Keyword Summary
  • 6.5.3. Vocabulary Practice
  • 6.5.4. Common Mistakes
  • 6.6. Mixed Up Code Practice
  • 6.7. Toggle Mixed Up or Write Code Practice
  • 6.8.1. More Practice
  • 6.9.1. Easier Multiple Choice Questions
  • 6.9.2. Medium Multiple Choice Questions
  • 6.9.3. Hard Multiple Choice Questions
  • 6.10. Practice Exam for Arrays
  • 6.11. More Code Practice with Arrays
  • 7.1.1. Packages and imports
  • 7.1.2. Declaring and Creating ArrayLists
  • 7.1.3. Programming Challenge : FRQ Digits
  • 7.1.4. Summary
  • 7.2.1. size()
  • 7.2.2. add(obj)
  • 7.2.3. add(index,obj)
  • 7.2.4. remove(index)
  • 7.2.5. get(index) and set(index, obj)
  • 7.2.6. Comparing arrays and ArrayList s
  • 7.2.7. Programming Challenge : Array to ArrayList
  • 7.2.8. Summary
  • 7.3.1. Enhanced For Each Loop
  • 7.3.2. For Loop
  • 7.3.3. While Loop
  • 7.3.4. ArrayList of Student Objects
  • 7.3.5. Programming Challenge : FRQ Word Pairs
  • 7.3.6. Summary
  • 7.4.1. Free Response - String Scramble B
  • 7.4.2. Free Response - Climbing Club A
  • 7.4.3. Free Response - Climbing Club B
  • 7.4.4. Free Response - Climbing Club C
  • 7.4.5. Free Response - CookieOrder A
  • 7.4.6. Free Response - CookieOrder B
  • 7.4.7. Free Response - StringFormatter A
  • 7.4.8. Free Response - StringFormatter B
  • 7.4.9. Free Response - Delimiters A
  • 7.4.10. Free Response - Delimiters B
  • 7.4.11. Free Response - Grid World A
  • 7.5.1. Sequential Search
  • 7.5.2. Binary Search
  • 7.5.3. Runtimes
  • 7.5.4. Programming Challenge : Search Runtimes
  • 7.5.5. Summary
  • 7.6.1. Selection Sort
  • 7.6.2. Insertion Sort
  • 7.6.3. Programming Challenge : Sort Runtimes
  • 7.6.4. Summary
  • 7.7.1. POGIL Groupwork: Data Privacy
  • 7.7.2. Summary
  • 7.8.1. Concept Summary
  • 7.8.2. Vocabulary Practice
  • 7.8.3. Common Mistakes
  • 7.9.1. Java File , Scanner , and IOException Classes
  • 7.9.2. Reading in Data with Scanner
  • 7.9.3. Reading in Files with java.nio.file
  • 7.9.4. Object-Oriented Design with CSV Files
  • 7.9.5. Programming Challenge: ArrayList of Objects from Input File
  • 7.10. Mixed Up Code Practice
  • 7.11. Toggle Mixed Up or Write Code Practice
  • 7.12. Code Practice with ArrayLists
  • 7.13.1. Easier Multiple Choice Questions
  • 7.13.2. Medium Multiple Choice Questions
  • 7.13.3. Hard Multiple Choice Questions
  • 7.13.4. Easier Search/Sort Multiple Choice Questions
  • 7.13.5. Medium Search/Sort Multiple Choice Questions
  • 7.13.6. Hard Search/Sort Multiple Choice Questions
  • 7.14. College Board Celebrity and Data Labs
  • 8.1.1. 2D Arrays (Day 1)
  • 8.1.2. Array Storage
  • 8.1.3. How Java Stores 2D Arrays
  • 8.1.4. Declaring 2D Arrays
  • 8.1.5. Set Value(s) in a 2D Array (Day 2)
  • 8.1.6. Initializer Lists for 2D Arrays
  • 8.1.7. Get a Value from a 2D Array
  • 8.1.8. Programming Challenge : ASCII Art
  • 8.1.9. Summary
  • 8.1.10. 2D Arrays Game
  • 8.2.1. Nested Loops for 2D Arrays (Day 1)
  • 8.2.2. Getting the Number of Rows and Columns
  • 8.2.3. Looping Through a 2D Array
  • 8.2.4. AP Practice
  • 8.2.5. Enhanced For-Each Loop for 2D Arrays (Day 2)
  • 8.2.6. 2D Array Algorithms
  • 8.2.7. 2D Array of Objects
  • 8.2.8. Programming Challenge : Picture Lab
  • 8.2.9. Summary
  • 8.2.10. AP Practice
  • 8.2.11. 2D Arrays and Loops Game
  • 8.3.1. Concept Summary
  • 8.3.2. Vocabulary Practice
  • 8.3.3. Common Mistakes
  • 8.4. Mixed Up Code Practice
  • 8.5. Toggle Mixed Up or Write Code Practice
  • 8.6. Code Practice with 2D Arrays
  • 8.7.1. Free Response - Gray Image A
  • 8.7.2. Free Response - Gray Image B
  • 8.7.3. Free Response - Route Cipher A
  • 8.7.4. Free Response - Route Cipher B
  • 8.8.1. Easier Multiple Choice Questions
  • 8.8.2. Medium Multiple Choice Questions
  • 8.8.3. Hard Multiple Choice Questions
  • 8.9.1. Picture Lab A1 - A3
  • 8.9.2. Picture Lab A4: 2D Arrays in Java
  • 8.9.3. Picture Lab A5: Modifying a Picture
  • 8.9.4. Picture Lab A6: Mirroring Pictures
  • 8.9.5. Picture Lab A7: Mirroring Part of a Picture
  • 8.9.6. Picture Lab A8: Creating a Collage
  • 8.9.7. Picture Lab A9: Simple Edge Detection
  • 8.10. More Code Practice with 2D Arrays
  • 9.1.1. Inheritance (Day 1)
  • 9.1.2. Subclass extends Superclass
  • 9.1.3. Why Use Inheritance?
  • 9.1.4. is-a vs. has-a (Day 2)
  • 9.1.5. is-a Substitution Test
  • 9.1.6. Programming Challenge : Online Store
  • 9.1.7. Summary
  • 9.2.1. Chain of initialization
  • 9.2.2. Programming Challenge : Square is-a Rectangle
  • 9.2.3. Summary
  • 9.3.1. Overloading Methods
  • 9.3.2. Inherited Get/Set Methods
  • 9.3.3. Programming Challenge : Pet Sounds
  • 9.3.4. Summary
  • 9.4.1. Programming Challenge : Customer Info
  • 9.4.2. Summary
  • 9.5.1. Superclass References
  • 9.5.2. Superclass Method Parameters
  • 9.5.3. Superclass Arrays and ArrayLists
  • 9.5.4. Programming Challenge : Shopping Cart
  • 9.5.5. Summary
  • 9.6.1. Programming Challenge : Shopping Cart 2
  • 9.6.2. Summary
  • 9.7.1. toString() method
  • 9.7.2. equals Method
  • 9.7.3. Overriding the equals Method
  • 9.7.4. Programming Challenge : Savings Account
  • 9.7.5. Summary
  • 9.8.1. Concept Summary
  • 9.8.2. Java Keyword Summary
  • 9.8.3. Vocabulary Practice
  • 9.8.4. Common Mistakes
  • 9.9.1. Free Response - Trio A
  • 9.9.2. Trio Student Solution 1
  • 9.9.3. Trio Student Solution 2
  • 9.9.4. Trio Student Solution 3
  • 9.10. Mixed Up Code Practice
  • 9.11. Toggle Mixed Up or Write Code Practice
  • 9.12. Code Practice with Object Oriented Concepts
  • 9.13.1. Easier Multiple Choice Questions
  • 9.13.2. Medium Multiple Choice Questions
  • 9.13.3. Hard Multiple Choice Questions
  • 9.13.4. More Practice
  • 9.14. College Board Celebrity Lab
  • 10.1.1. What is Recursion? (Day 1)
  • 10.1.2. Why use Recursion?
  • 10.1.3. Factorial Method
  • 10.1.4. Base Case
  • 10.1.5. Tracing Recursive Methods (Day 2)
  • 10.1.6. Tracing Challenge : Recursion
  • 10.1.7. Summary
  • 10.2.1. Recursive Binary Search
  • 10.2.2. Merge Sort
  • 10.2.3. Tracing Challenge : Recursive Search and Sort
  • 10.2.4. Summary
  • 10.3.1. Concept Summary
  • 10.3.2. Vocabulary Practice
  • 10.3.3. Common Mistakes
  • 10.4. Mixed Up Code Practice
  • 10.5. More Mixed Up Code Practice
  • 10.6. Toggle Mixed Up or Write Code Practice
  • 10.7. Code Practice for Recursion
  • 10.8.1. Base Case Practice
  • 10.8.2. Easier Multiple Choice Questions
  • 10.8.3. Medium Multiple Choice Questions
  • 10.8.4. Hard Multiple Choice Questions
  • 11.1. Post Test
  • 11.2. Post-Survey
  • 12.1. Preparing for the AP CSA Exam
  • 12.2. Exam 1 for the AP CSA Exam (not timed)
  • 12.3. Exam 2 for the AP CSA Exam (not timed)
  • 12.4. Exam 3 for the AP CSA Exam (not timed)
  • 12.5. Exam 4 for the AP CSA Exam (not timed)
  • 12.6. Exam 5 for the AP CSA Exam (not timed)
  • 12.7. Exercises
  • 13.1. Practice Exam 1 for the AP CSA Exam
  • 13.2. Practice Exam 2 for the AP CSA Exam
  • 13.3. Practice Exam 3 for the AP CSA Exam
  • 13.4. Practice Exam X
  • 13.5. AP Bowl 2021 - Part A
  • 14.1.1. Mixed Up Code Practice
  • 14.1.2. More Mixed Up Code Practice
  • 14.2.1. Try and Solve It - Again
  • 14.3. RandomStringChooser - Part B Parsons
  • 14.4.1. Try and Solve It - Again
  • 14.5. Exercises
  • 15.1.1. Try and Solve It
  • 15.2.1. Try and Solve It
  • 15.3.1. Try and Solve It
  • 15.4.1. Try and Solve It
  • 15.5.1. Try and Solve It
  • 15.6.1. Try and Solve It
  • 15.7.1. Try and Solve It
  • 15.8.1. Try and Solve It
  • 15.9.1. Try and Solve It
  • 15.10.1. Try and Solve It
  • 15.11.1. Try and Solve It
  • 15.12.1. Try and Solve It
  • 15.13.1. Try and Solve It
  • 15.14. Exercises
  • 16.1.1. Impostor Syndrome
  • 16.1.2. A Lack of Diversity
  • 16.2.1. Anaya Taylor
  • 16.2.2. Bryan Hickerson
  • 16.2.3. Briceida Mariscal
  • 16.2.4. Carla De Lira
  • 16.2.5. Camille Mbayo
  • 16.2.6. Destini Deinde-Smith
  • 16.2.7. Eric Espinoza
  • 16.2.8. Dr. Gloria Opoku-Boateng
  • 16.2.9. Dr. Juan Gilbert
  • 16.2.10. Luisa Morales
  • 16.2.11. Lucas Vocos
  • 16.2.12. Lien Diaz
  • 16.2.13. Milly Rodriguez
  • 16.2.14. Dr. Nettrice Gaskins
  • 17. Hidden Items

Search Page

If you see errors or bugs, please report them with this errors form . If you are a teacher who is interested in CSAwesome PDs or community, please fill out this PD interest form and join the teaching CSAwesome group which will give you access to lesson plans at csawesome.org .

(last revised 1/6/2024)

© Copyright 2014-2024 Barb Ericson, Univ. Michigan; 2019-2024 Beryl Hoffman, Elms College; 2023-2024 Peter Seibel, Berkeley High School. All rights reserved.

Created using Runestone .

IMAGES

  1. 025 Compound assignment operators (Welcome to the course C programming

    1.4.2 compound assignment operators quiz

  2. PPT

    1.4.2 compound assignment operators quiz

  3. Exploring Compound Assignment Operators in C

    1.4.2 compound assignment operators quiz

  4. Compound Assignment Operators

    1.4.2 compound assignment operators quiz

  5. COMPOUND ASSIGNMENT OPERATORS

    1.4.2 compound assignment operators quiz

  6. Java Lesson 12

    1.4.2 compound assignment operators quiz

VIDEO

  1. 6.08 Quiz Represent Compound Events and Outcomes (Tutorial Video)

  2. Exercise 4c Question no 3 D1 Math Oxford New Syllabus || Chapter 4 || Book 1 Math ||

  3. 61. Compound Operators

  4. Compound Assignment Operators in C++ || C++ Programming #viral #subscribe

  5. Day 8

  6. C++ Basics: Operators

COMMENTS

  1. 1.4 Compound Assignment Operators Flashcards

    Study with Quizlet and memorize flashcards containing terms like compound assignment operator, compound assignment operator ex., int varName = 5; varName %= 2; System.out.print(varName); and more. ... 20.1.1 Primitive Types Quiz. 25 terms. persaud_2021. Preview. Unit 1: Primitive Types. 50 terms. eiramerialc. Preview. unit 1 progress check MCQ ...

  2. Compound assignment operators in Java

    The following are all possible assignment operator in java: 1. += (compound addition assignment operator) 2. -= (compound subtraction assignment operator) 3. *= (compound multiplication assignment operator) 4. /= (compound division assignment operator) 5. %= (compound modulo assignment operator)

  3. Compound assignment operators Flashcards

    Study with Quizlet and memorize flashcards containing terms like =, +=, -= and more.

  4. 1.4. Expressions and Assignment Statements

    In this lesson, you will learn about assignment statements and expressions that contain math operators and variables. 1.4.1. Assignment Statements ¶. Remember that a variable holds a value that can change or vary. Assignment statements initialize or change the value stored in a variable using the assignment operator =.

  5. AP Computer Science A (Nitro)

    1.4 Compound Assignment Operators. Video 1.4.1 Compound Assignment Operators. Check for Understanding 1.4.2 Compound Assignment Operators. ... Check for Understanding 9.5.2 Quiz: References Using Inheritance Hierarchies. Example 9.5.3 Animal Sounds. Example 9.5.4 Shape Areas. Example 9.5.5 Person Class.

  6. 1.4

    You asked for it, so here it is: more operators! Wait...you didn't ask for more operators? Well, what am I supposed to do with them all?00:00 - Intro00:13 - ...

  7. Compound Assignment Operators

    Compound Assignment Operators. We often apply an operator to an object and then assign the result to that same object. As an example, consider the sum program from § 1.4.2 (p. 13): int sum = 0;// sum values from 1 through 10 inclusive for (int val = 1; val <= 10; ++val) sum += val; // equivalent to sum = sum + val

  8. What Is a Compound-Assignment Operator?

    Compound-Assignment Operators. Compound-assignment operators provide a shorter syntax for assigning the result of an arithmetic or bitwise operator. They perform the operation on the two operands before assigning the result to the first operand.

  9. Compound assignment operators

    The compound assignment operators consist of a binary operator and the simple assignment operator. They perform the operation of the binary operator on both operands and store the result of that operation into the left operand, which must be a modifiable lvalue. The following table shows the operand types of compound assignment expressions:

  10. Activity 1.1.4 Compound Assignment Operators Flashcards

    Study with Quizlet and memorize flashcards containing terms like Concatenate, Concatenation Operator, Compound Assignment Operator and more.

  11. aditeyapatakoti/CodeHS-IntroIntoJavascript

    This repository includes answers and code to every quiz and assignment needed in CodeHS's course called "Introduction to Computer Science in Javascript (Golden) 2022". To find a specific assignment click on the Go to File button near the top of all of the files and then type in the assignment number.

  12. Worked Example: Compound Operators

    1.14 Worked Example: Compound Operators. 1.14.1. 1.14.2 SG1 : Determine resultant data type of expression. 1.14.3 SG2: ... (RHS) of the statement, but compound assignment operators are a special shorthand than includes the compounded operation with the left-hand-side (LHS). A much simpler example could be gamma += 1;, ...

  13. 1.4 Compound Assignment Operators

    compound operatorsshortcutsincrement ++decrement --https://repl.it/@bzurla/14-Compound-Assignment-Operators

  14. 1. Getting Started and Primitive Types

    1.4 Expressions and Assignment Statements; 1.5 Compound Assignment Operators; 1.6 Casting and Ranges of Values; 1.7 Unit 1 Summary; 1.8 Mixed Up Code Practice; 1.9 Toggle Mixed Up or Write Code Practice; 1.10 Coding Practice; 1.11 Multiple Choice Exercises

  15. Operators Flashcards

    The C++ for looping structure is a specialized form of the while loop. Its primary purpose is to simplify the writing of couter-controlled loops. Study with Quizlet and memorize flashcards containing terms like Assignment operator, The assignment operator, Addition + Subtraction - Multiplication * Division / Modulo % and more.

  16. AP Computer Science A (Nitro)

    Video 1.4.1 Compound Assignment Operators. Check for Understanding 1.4.2 Compound Assignment Operators. Example 1.4.3 All Functions Calculator. Example 1.4.4 Increase/Decrease by 1. ... Check for Understanding 9.5.2 Quiz: References Using Inheritance Hierarchies. Example 9.5.3 Animal Sounds. Example 9.5.4 Shape Areas. Example 9.5.5 Person Class.

  17. Python

    A special case scenario for all the compound assigned operators. i= 2 ; i+= 2 * 2 ; #equals to, i = i+(2*2); In all the compound assignment operators, the expression on the right side of = is always calculated first and then the compound assignment operator will start its functioning. Hence in the last code, statement i+=2*2; is equal to i=i+ ...

  18. 1.5. Compound Assignment Operators

    1.5. Compound Assignment Operators¶. Compound assignment operators are shortcuts that do a math operation and assignment in one step. For example, x += 1 adds 1 to the current value of x and assigns the result back to x.It is the same as x = x + 1.This pattern is possible with any operator put in front of the = sign, as seen below. If you need a mnemonic to remember whether the compound ...

  19. CS Lab03 Flashcards

    Lab 07 T/F and Lab Quiz Questions. 33 terms. Wendy_na. Preview. Data Structure and Algorithm. 47 terms. Chickenfiox_ Preview. PRE 7 Lesson 6. 42 terms. quizlette56946675. ... All of the compound assignment operators share the same level of operator precedence. True. The result of an expression is undefined when it attempts to modify a single ...

  20. 1.4. Expressions and Assignment Statements

    In this lesson, you will learn about assignment statements and expressions that contain math operators and variables. 1.4.1. Assignment Statements ¶. Assignment statements initialize or change the value stored in a variable using the assignment operator =. An assignment statement always has a single variable on the left hand side.

  21. CHEM 101 Unit 1.4.2

    used to indicate the number of molecules. determine the charge of each ion, cations and anions must combine to a net charge of 0, balance the valences. -metals have a charge equal to the group number. -nonmetals have a charge equal to the group number minus eight. name the cation and then put the anion and change the suffix to "-ide".

  22. AP CSA Java Course

    A shortcut way to get to this site is to type in the url: course.csawesome.org. CSAwesome is a College Board endorsed curriculum for AP Computer Science A, an introductory college-level computer programming course in Java. If you are a teacher using this curriculum, please join the teaching CSAwesome group which will give you access to teacher ...