1. Butun turdagi son qabul qiluvchi digitSum nomli metod yarating. Uning vazifasi berilgan sonni raqamlari yig`indisini qaytarish.
2. Quyidagi matematik ifodani hisoblash dasturini tuzing :
3. Butun turdgi massiv va N son berilgan. Sizning vazifangiz berilgan massivdagi elementlarning yig`indisi N ga teng bo`lgan juftliklarning indexnini ekranga chiqarish.
4. Son palindrom deyiladi agarda u to`g`ri va teskari tomondan ham bir hil bo`lsa. Masalan 121 son pandrom, 123 palindrom emas.
5. Ikkita butun sonlardan iborat bo`lgan sonlar to`plami berilgan .Sizning vazifangiz to`plamlarni birlashtirish va ularni o`sish taribida joylashtirish.
6. SavingAccount nomli class yarating. Static turda annualInterestRate nomli o`zgaruvchini barcha foydalanish uchun yarating. private turda savingBalance nomli va hozirgi balansni saqlovchi o`zgaruvchi yarating. savingBalance ni annualInterestRate ga ko`paytmasi va 12 ga bo`lish oylik interestni topuvchi va uni savingBalancega qo`shuvchi calculateMonthlyInterest metodini yarating. modifyInterestRate nomli va annualInterestRate ga yangi qiymat beruvchi static metod yarating. Testlash uchun SaveAccount dan 2 ta instance save1, save2 oling va 2000$, 3000$ qiymatlar kiting. AnnualInterestRate ga 4% kiriting va monthlyInterestni hisoblang va ekranga savingbalansni chiqaring. Keyin annualInterestRate ga 5% kiriting va monthlyInterestni hisoblang va ekranga savingBalance ni chiqaring
SavingsAccount saver1 = new SavingsAccount();
SavingsAccount saver2 = new SavingsAccount();
saver1.setSavingsBalance(2000);
saver2.setSavingsBalance(3000);
SavingsAccount.modifyInterestRate(0.04);
saver1.calculateMonthlyInterest();
saver2.calculateMonthlyInterest();
print("New Balance for Saver1=",saver1.getSavingsBalance());
print("New Balance for Saver2=",saver2.getSavingsBalance());
SavingsAccount.modifyInterestRate(0.05);
saver1.calculateMonthlyInterest();
saver2.calculateMonthlyInterest();
print("New Balance for Saver1=",saver1.getSavingsBalance());
print("New Balance for Saver2=",saver2.getSavingsBalance());