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!
Diese Übung ist Teil des Kurses
Introduction to Java
Anleitung zur Übung
- Assign
itemCountthe value of3425. - Declare the
totalPricevariable using the correct primitive type and assign the value of11999.99.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
class NumericalDeclarations {
public static void main(String[] args) {
// Declare and assign variables
int itemCount = ____;
____ totalPrice ____ ____;
}
}