Menu
Coddy logo textTech

Declaring Number

Part of the Fundamentals section of Coddy's Dart journey — lesson 88 of 94.

challenge icon

Challenge

Easy

Now that we have the basic structure of our program, let's add some number variables that our calculator will use.

Update your calculator program to:

  1. Declare two double variables named firstNumber and secondNumber
  2. Initialize firstNumber with the value 10.5
  3. Initialize secondNumber with the value 5.5
  4. Print both numbers using exactly these formats:
    • "First number: 10.5"
    • "Second number: 5.5"

Try it yourself

void main() {
  print("Welcome to the Simple Calculator!");
  
  // Declare your number variables here
}

All lessons in Fundamentals