Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Learn Dart for free with this interactive course. Dart is a clean, simple, class-based object-oriented language that has more structure than JavaScript, the programming language it’s heavily based on.
However, you can’t have a conversation about Dart without mentioning Flutter.
Flutter is Google’s mobile UI framework used for crafting high-quality native interfaces on iOS and Android. Flutter applications are written using the Dart programming language, which has helped make Dart a beloved language by the developer community. Before you can start fluttering out applications using Flutter, you need to learn Dart.
This course will help you learn the fundamentals of Dart, and get you started on your journey to learning Flutter. Start learning today.
Answer:
print("My mamma always said, life is like a box of chocolates. You never know what you're gonna get.");
Q1. What constitutes as an application entry point in Dart?
main()
functionQ2. What does it mean for a programming language to be imperative?
Q3. What is a library in computer programming?
Q4. What is the purpose of the dart:io
library?
Q5. Which of the following programs would you use to get input from the user?
main() {
stdin.readLineSync();
}
import 'dart:io';
main() {
stdin.readLine();
}
import 'dart:io';
main() {
stdin.readLineSync()
}
Answer:
print("$name is $age years old.");
Q1. Variables are used for storing data.
Q2. What role does the variable name play when declaring a variable?
Q3. What type includes integers and doubles?
Q4. What is the default value of an uninitialized variable?
Q5. In which of the following examples are we not assigning a literal to the variable b
?
main() {
var a = 1;
var b = a;
}
main() {
var a = 1;
var b = 'a';
}
main() {
var a = 1;
var b = 1;
}
Q6. What is string interpolation?
Q7. What would the output be of the given code?
main() {
print("3 + 2 = ${3 + 2}");
}
Q8. Which of the following examples is using type inference?
main() {
bool variable = true;
}
main() {
num variable = 5;
}
main() {
var variable = 'hello';
}
Q9. Which of the following comes first?
Answer:
var compareCheck = (check < 75) && (check >= 8);
Answer:
var celsius = (fahrenheit - 32) * 5 / 9;
Q1. What makes an expression different from a simple statement?
Q2. Which of the following describes infix notation?
Q3. Select the correct output for the following code:
main() {
int operand1 = 7;
int operand2 = 3;
print(operand1 ~/ operand2);
}
Q4. Select the correct output for the following code:
main() {
var operand1 = 's';
var operand2 = 'q';
print(operand1 == operand2);
}
Q5. Select the correct output for the following code:
main() {
var A = true;
var B = true;
var exp = A || B;
print(false && exp);
}
Q6. Select the correct output for the following code:
main() {
var operand1 = 7;
var operand2 = 3;
print(operand1 & operand2);
}
Q7. Select the correct output for the following code:
main() {
var operand1 = 7;
var operand2 = 3;
operand1 += operand2;
print(operand1);
}
Q8. Select the correct output for the following code:
main() {
var operand = 7;
print(operand++);
}
Q9. Which of the following is correct in terms of operator precedence (from left to right)?
<
, *
, &
!=
, |
, ^
==
, :
, ( )
Answer:
var cubes = integers.map((integer) => integer * integer * integer).toList();
Q1. How many built-in core collections does Dart provide?
Q2. What does it mean for a collection to be ordered?
Q3. What will be the output of the following code?
main() {
var temp = [6,8,23,97,10];
var index = temp.indexOf(8);
temp.removeAt(index);
print(temp);
}
Q4. Choose the correct syntax for the map()
method.
Q5. What will be the output of the following code?
main() {
var temp = {6,8,23,97,10};
var temp2 = {8,25,7,1,90,34,23,10};
var intersectionSet = temp.union(temp2);
print(intersectionSet);
}
Q6. What comes first when creating a map?
Q7. Which of the following uses indexes?
Answer:
// Check if student has passed or failed
if (percentage >= 60 && percentage > (average-5)){
print("pass");
}else {
print("fail");
}
Answer:
var evenList = List();
for(var i = 0; i <integers.length; i++){
if((integers[i] * 3) % 2 == 0){
evenList.add(integers[i] * 3);
}
}
Answer:
while (temperature<375) {
temperature += 25;
count +=1;
}
Answer:
switch(color) {
case "blue":
print("orange");
break;
case "yellow":
print("purple");
break;
case "red":
print("green");
break;
default:
print("not a primary color");
}
Q1. What are control structures used for?
Q2. What will be the output of the following code?
main() {
var a = 7;
var b = 2;
var result = a>b ? b-a : a-b;
print(result);
}
Q3. What will be the output of the following code?
main() {
var list = [1,2,3,4,5];
for (var i in list) {
if (i % 2 != 0) {
print(i);
}
}
}
1
2
3
4
5
1
3
5
2
4
Q4. What will be the output of the following code?
main() {
dynamic constantPattern= List();
switch(constantPattern){
case 5:
print("five");
break;
case true:
print("truth");
break;
case "hello":
print("hi!");
break;
case null:
print("the empty list");
break;
default:
print("something else");
break;
}
}
Q5. How many times will the print()
method be called in the following code?
main() {
var experience = [5,1,9,7,2,4];
for(var i = 0; i < experience.length; i++){
var candidateExperience = experience[i];
if(candidateExperience < 5){
continue;
} else {
break;
}
print("Call candidate $i for an interiew.");
}
}
Q6. What will happen when we run the following code?
main() {
assert((3 << 1) == 7);
}
Answer:
num absolute(num x) {
var abs = x < 0 ? -x : x;
return abs;
}
Answer:
int sum(List<int> numberList, int index) {
if(index < 0 ){
return 0;
} else {
return numberList[index] + sum(numberList, index-1);
}
}
Answer:
num arithmeticCalculator(Function f, int x, int y){
return f(x,y);
}
Answer:
int mainMax(int a, int b, int c) {
int max(int x, int y) {
if(x > y){
return x;
} else{
return y;
}
}
return max(a,max(b,c));
}
Q1. Which of the following are optional when defining a basic function?
Q2. Is the below function declaration using named parameters or positional parameters?
String param(String a, int b, [num c]) {
}
``
Q3. What does it mean for a function to be treated as a first-class value?
Q4. The code snippets below are anonymous functions which return the product of two numbers. Which of the following is the correct implementation?
(x,y) {
x*y;
}
(x,y) {
x*y;
} ;
x,y {
x*y;
}
Q5. What is syntactic sugar?
Q1. A blueprint is used to create identical copies of the same object.
Q2. The members of a class can be divided into the following two parts:
Q3. Why is an object known as an instance of a class?
Q4. The code below declares an EqualShape
class and creates its instance, square
, whose property, numOfSides
, is assigned a value of 5.
Why will the code not compile?
class EqualShape{
var numOfSides=0;
var lengthOfSides=0;
perimeter() {
return numOfSides * lengthOfSides;
}
}
int main() {
var square = EqualShape;
square.numOfSides = 5;
}
Q5. What will be the output of the following code?
class EqualShape{
var numOfSides = 0;
var lengthOfSides = 0;
perimeter(){
return numOfSides * lengthOfSides;
}
}
int main() {
var shape = EqualShape();
shape.numOfSides = 5;
shape.lengthOfSides = 5;
var result = shape.perimeter();
print(result);
}
I hope this Learn Dart: First Step to Flutter Educative Quiz Answers would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>