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
abstract class Account{ | |
int accountNumber; | |
double accountBalance; | |
Account(this.accountNumber,this.accountBalance); | |
void deposit(double amount)=> accountBalance += amount; | |
void withdraw(double amount); |
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
add List of sum in a sigle value by this way ------------------------------- | |
void main() { | |
List<double> itemPrice= [15.99, 18.75, 21.40, 53.09]; | |
double sum=0; | |
double totalPrice=0; | |
var numbers= itemPrice.map((value)=> value).reduce((previous,present)=>previous+present); // we can use also fold() function | |
// for (double item in itemPrice) { | |
// sum+=item; | |
// totalPrice= sum * 1.05; // eta 5% vat soho |
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() { | |
Student student = Student(); // here we can also provide values | |
student.sayHello(); | |
print(student.getRollSquared()); | |
student.getAddress(); | |
} | |
class Student{ | |