List_Example_Dart
import "dart:io";
import "dart:core";
// void main()
// {
// var accountHolder = [];
// print("Enter the Account holder Name : ");
// var a = stdin.readLineSync();
// print("Enter the Account holder phone no : ");
// var b = int.parse(stdin.readLineSync()!);
// print("Enter the Account holder address : ");
// var c = stdin.readLineSync();
// print("Enter the Account holder age : ");
// var d = int.parse(stdin.readLineSync()!);
// print("Enter the Account Type : ");
// var account_type = stdin.readLineSync();
// print("Enter the Account Number : ");
// var f = int.parse(stdin.readLineSync()!);
// print("Enter the Deposit Amount : ");
// var deposit = int.parse(stdin.readLineSync()!);
// print("Enter the days : ");
// var days = int.parse(stdin.readLineSync()!);
// print("Are You want to Sure ?");
// var surety = stdin.readLineSync();
// print("Enter the Withdrawal Amount : ");
// var withdrawal = int.parse(stdin.readLineSync()!);
// print("Enter the Minimum Amount for Withdrawal : ");
// var min_balance = int.parse(stdin.readLineSync()!);
//
// accountHolder.addAll([a, b, c, d, account_type, f, deposit, days, surety, withdrawal, min_balance]);
// print(accountHolder);
//
// if(account_type == "saving")
// {
// if(days == 30)
// {
// if(surety == "yes")
// {
// if(min_balance == 1000)
// {
// print("Account Holder can get withdraw from Account because he has minimum balance 1000");
// print("Account Holder get 5 % interest because days limit is 30 days");
// var interest = (withdrawal * 5)/100;
// print("Account Holder will get ${interest} Rupees Interest\n\n");
//
// print("Account Holder Name : ${a}");
// print("Account Holder phone No : ${b}");
// print("Account Holder Address : ${c}");
// print("Account Holder Age : ${d}");
// print("Account Holder Type : ${account_type}");
// print("Account Holder number : ${f}");
// print("Account Holder Deposit Amount : ${deposit - withdrawal}");
// print("Account Holder withdrawal Amount : ${withdrawal}\n\n");
//
// var range = accountHolder.length;
// accountHolder.removeRange(0,range);
// accountHolder.addAll([a, b, c, d, account_type, f, deposit-withdrawal, days, surety, withdrawal, min_balance]);
// print(accountHolder);
// }
// }
// else
// {
// print("Account Holder can not get withdraw from Account because he has not minimum balance 1000");
// print("Account Holder get 6.5 % interest because days limit is 60 days");
// var interest1 = (withdrawal * 6.5)/100;
// print("Account Holder will get ${interest1} Rupees Interest");
// }
// }
// }
// else
// {
// print("Account Holder will not get interest because Account type is current Account");
// }
//
// }
void main()
{
//int myarray[]=new int[5]''
//myarray[0]=100;
List<int>list=List.filled(5, 5);
print(list);
list[0]=100;
print(list);
///EXAMPLE 1
List gfg = List.filled(5, null, growable: false);
gfg[0] = "Geeks";
gfg[1] = "For";
gfg[2] = "Geeks";
///Printing all the values in the List
print(gfg);
///Printing value at specific position
print(gfg[2]);
print(gfg[1]);
///EXAMPLE 2
// var gfg = ["Geeks"];
// print(gfg);
//
// gfg.insertAll(1, ["For", "Geeks"]);
// print(gfg);
//
// print(gfg[1]);
///EXAMPLE 3 : PENDING
// var a = 3;
// var b = 3;
//
// var gfg = List.generate(a, (i) => List(b), growable: false);
//
// print(gfg);
//
// for(int i = 0; i < 3; ++i)
// {
// for(int j = 0; j < 3; ++j)
// {
// gfg[i][j] = i + j;
// }
// }
// print(gfg);
///EXAMPLE 4
// var gfg = List.generate(3, (i) => List.generate(3, (j) => i + j));
//
// // Printing its value
// print(gfg);
///EXAMPLE 5
// var gfg = List.generate(3, (i) => List.generate(3,
// (j) => List.generate(3,
// (k) => i + j + k)));
// print(gfg);
///EXAMPLE 6
var SALARY = [], TA = [], DA = [], HRA = [], PF = [], TOTAL_SALARY = [], ta = [], da = [],
hra = [], pf = [], total_salarylist = [], allInformation = [];
print("Enter the Salary : ");
SALARY.add(int.parse(stdin.readLineSync()!));
print("Enter the TA(in %) : ");
TA.add(int.parse(stdin.readLineSync()!));
print("Enter the DA(in %) ");
DA.add(int.parse(stdin.readLineSync()!));
print("Enter the HRA(in %) ");
HRA.add(int.parse(stdin.readLineSync()!));
print("Enter the PF(in %) ");
PF.add(int.parse(stdin.readLineSync()!));
print("Enter the TOTAL SALARY(in %) ");
TOTAL_SALARY.add(int.parse(stdin.readLineSync()!));
for(int i = 0; i < 1; i++)
{
var salary = (SALARY[i] * TA[i])/100;
ta.add(salary);
allInformation.add(salary);
print(ta);
var taCal = (SALARY[i] * DA[i])/100;
da.add(taCal);
allInformation.add(taCal);
print(da);
var daCal = (SALARY[i] * HRA[i])/100;
hra.add(daCal);
allInformation.add(daCal);
print(hra);
var pfCal = (SALARY[i] * PF[i])/100;
pf.add(pfCal);
allInformation.add(pfCal);
print(pf);
var total_salary = (SALARY[i] * TOTAL_SALARY[i])/100;
total_salarylist.add(total_salary);
allInformation.add(total_salary);
print(total_salarylist);
print("TA is : ${ta}\nDA is : ${da}\nHRA is : ${hra}\nPF is : ${pf}\n"
"TOTAL SALARY is : ${total_salarylist}\n");
print(allInformation);
}
}
Comments
Post a Comment