0
0
Fluttermobile~10 mins

Data types (int, double, String, bool) in Flutter - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to declare an integer variable named count with value 10.

Flutter
int count = [1];
Drag options to blanks, or click blank then click option'
A"10"
B10.0
C10
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around the number, which makes it a String.
Using a decimal number like 10.0 which is a double.
2fill in blank
medium

Complete the code to declare a double variable named price with value 9.99.

Flutter
double price = [1];
Drag options to blanks, or click blank then click option'
A9.99
Btrue
C"9.99"
D9
Attempts:
3 left
💡 Hint
Common Mistakes
Using an integer value like 9 instead of 9.99.
Putting the number inside quotes, making it a String.
3fill in blank
hard

Fix the error in the code by completing the declaration of a String variable named greeting with value Hello.

Flutter
String greeting = [1];
Drag options to blanks, or click blank then click option'
Atrue
B"Hello"
CHello
D9
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the text.
Using single quotes inconsistently (though Dart allows single quotes, this example expects double quotes).
4fill in blank
hard

Fill both blanks to declare a boolean variable named isActive set to true.

Flutter
bool isActive = [1];
Drag options to blanks, or click blank then click option'
A"true"
B"false"
Cfalse
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around true or false, which makes them Strings.
Using the wrong boolean value.
5fill in blank
hard

Fill all three blanks to declare variables: an int age 25, a double height 1.75, and a String name "Alice".

Flutter
int age = [1];
double height = [2];
String name = [3];
Drag options to blanks, or click blank then click option'
A25
B1.75
C"Alice"
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numbers inside quotes.
Using wrong types for the values.