Skip to content

Instantly share code, notes, and snippets.

@azeezco
azeezco / mytask.dart
Last active October 29, 2022 16:20
HNG9 Mobile track task 1.
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: ");
@azeezco
azeezco / Bank.dart
Created October 7, 2022 10:57
Console bank that does withdrawal and deposit transaction. Can also check balance.
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;
@azeezco
azeezco / Calculator.dart
Created October 5, 2022 07:49
Console Calculator that performs arithmetic operations on two numbers
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
}
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.