Dart Programming Flashcard

Dart Programming Flashcard

Assessment

Flashcard

Computers

12th Grade

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

20 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which keyword is used to declare a compile-time constant in Dart? Options: var, final, const, dynamic

Back

const

Answer explanation

In Dart, the keyword 'const' is used to declare compile-time constants. Unlike 'final', which allows for runtime constants, 'const' ensures that the value is determined at compile time.

2.

FLASHCARD QUESTION

Front

A while loop in Dart runs as long as the condition is true.

Back

True

Answer explanation

True. In Dart, a while loop continues to execute as long as the specified condition evaluates to true. Once the condition becomes false, the loop terminates.

3.

FLASHCARD QUESTION

Front

The var keyword in Dart is used to declare a variable whose __________ is inferred automatically.

Back

data type

Answer explanation

The var keyword in Dart allows for variable declaration without explicitly stating the data type. The type is inferred automatically based on the assigned value, making it flexible and convenient for developers.

4.

FLASHCARD QUESTION

Front

What will this code print? Options: 5, 10, 25, 7

Back

10

Answer explanation

The code initializes x to 5, then multiplies it by 2 using the *= operator. This results in x being updated to 10. Therefore, the code will print 10.

5.

FLASHCARD QUESTION

Front

Which of the following data types is used to represent floating-point numbers? int, double

Back

double

Answer explanation

The 'double' data type is used to represent floating-point numbers, allowing for decimal values and greater precision than 'int', which is used for whole numbers. Therefore, 'double' is the correct choice.

6.

FLASHCARD QUESTION

Front

The final keyword allows you to assign a value only once, but the value can be set at runtime.

Back

True

7.

FLASHCARD QUESTION

Front

What is the output of this loop? Options: Count: 0, Count: 1, Count: 2, Count: 1, Count: 2, Count: 3, Count: 1, Count: 3, No output

Back

Count: 1, Count: 2, Count: 3

Answer explanation

The loop starts counting from 1 and increments until it reaches 3. Therefore, the output will be 'Count: 1, Count: 2, Count: 3', which matches the correct answer choice.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?