ComeçarComece de graça

Assigning numbers

Working with numbers is fundamental in programming - from counting items to calculating prices. Let's practice declaring and assigning numeric variables with real values!

Este exercício faz parte do curso

Introduction to Java

Ver curso

Instruções do exercício

  • Assign itemCount the value of 3425.
  • Declare the totalPrice variable using the correct primitive type and assign the value of 11999.99.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

class NumericalDeclarations {
    public static void main(String[] args) {
    
        // Declare and assign variables
        int itemCount = ____;
        ____ totalPrice ____ ____;
    }
}
Editar e executar o código