Aloqa uchun
Tel:

+998712412027

Facebook

@ykfoundationuz

Instagram

@Yoshlarkelajagimiz

Sayt www.yoshlarkelajagimiz.uz

 

Manzil:  Toshkent 100011, Alisher Navoiy ko’chasi 11-uy

Avtobuslar:  № 115, 98, 28, 89, 44, 141, 53, 144, 46, 91

Marshrut taksilari:  76

Avtobus bekati:  San’at saroyi

Yaqin metro bekatlari:  Alisher Navoiy, Paxtakor

Ish kunlari:  Dushanba-Juma

Ish vaqti:  9:00-18:00 (13:00-14:00 tushlik)

import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.EditText; import android.widget.TextView; import java.text.DecimalFormat; public class LoanCalculatorActivity extends AppCompatActivity { private EditText mLoanAmount, mInterestRate, mLoanPeriod; private TextView mMontlyPaymentResult, mTotalPaymentsResult; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_loan_calculator); mLoanAmount = (EditText) findViewById(R.id.loan_amount); mInterestRate = (EditText) findViewById(R.id.interest_rate); mLoanPeriod = (EditText) findViewById(R.id.loan_period); mMontlyPaymentResult = (TextView) findViewById(R.id.monthly_payment_result); mTotalPaymentsResult = (TextView) findViewById(R.id.total_payments_result); } public void showLoanPayments(View clickedButton) { double loanAmount = Integer.parseInt(mLoanAmount.getText().toString()); double interestRate = (Integer.parseInt(mInterestRate.getText().toString())); double loanPeriod = Integer.parseInt(mLoanPeriod.getText().toString()); double r = interestRate / 1200; double r1 = Math.pow(r + 1, loanPeriod); double monthlyPayment = (double) ((r + (r / (r1 - 1))) * loanAmount); double totalPayment = monthlyPayment * loanPeriod; mMontlyPaymentResult.setText(new DecimalFormat("##.##").format(monthlyPayment)); mTotalPaymentsResult.setText(new DecimalFormat("##.##").format(totalPayment)); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_loan_calculator, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }