This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
main() { | |
//Create circles | |
Circle circle1 = Circle(); | |
Circle circle2 = Circle.withRadius(2); | |
Circle circle3 = Circle.withRadiusAndClor(2, "blue"); | |
//Print circles | |
print("Circle 1: "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Account { | |
Account(this.accountNumber, this.accountBalance, this.accountName); | |
final String accountName; | |
final int accountNumber; | |
int accountBalance; | |
checkBalance() => print("Your account balance is $accountBalance"); | |
makeDeposit(int depositAmount) { | |
accountBalance = accountBalance + depositAmount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
print(addTwoNumbers(2,5)); //7 | |
print(subtTwoNumbers(2,5)); //-3 | |
print(divideTwoNumbers(2,5).toInt()); //0 | |
print(multTwoNumbers(2,5)); //10 | |
print(moduTwoNumbers(2,5)); //2 | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
var num = 0; //Declaring and initializing variable 'num' | |
while (num <=29) { // while num is less or equal to 29. | |
num = num + 1; // increment num by 1 and set it it to num. | |
if (num == 30) { // check if num is equal to 30. | |
print("The number is at $num"); | |
break; // break the while loop. |