17BCS0077MADDA2.pdf - MOBILE APPLICATION DEVELOPMENT DIGITAL ASSESSMENT-2 BY SADHANA.C 17BCS0077-01 Assume that a bank maintains two kinds of accounts

17BCS0077MADDA2.pdf - MOBILE APPLICATION DEVELOPMENT...

This preview shows page 1 - 4 out of 22 pages.

MOBILE APPLICATION DEVELOPMENT DIGITAL ASSESSMENT-2 BY: SADHANA.C 17BCS0077 ------------------------------------------------------------------------------------ 01. Assume that a bank maintains two kinds of accounts for customers, one called as savings account and the other as current account. The saving account provides compound interest and withdrawal facilities but no cheque book facility. The current account provides cheque book facility but no interest. Current account holders should also maintain a minimum balance and if the balance falls below this level, a service charge is imposed. Create an android application that stores customer name (textbox), account number (textbox), gender (radio button), branch (checkbox), balance (text box) and the type of account (check box). Perform the following operations. Check validity that account number should be exactly 10 digits and the amount to deposit or withdraw should be > Rs.100 Accept deposit from a customer and update the balance in database. Display the balance in another activity. ANDROID PROGRAM: Activity main.java package com.example.da2; import androidx.appcompat.app.AppCompatActivity; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.CheckBox; import android.widget.EditText;
Image of page 1
import android.widget.RadioButton; import android.widget.RadioGroup; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void check(View view) { EditText et1 = (EditText)findViewById(R.id.et1); EditText et2 = (EditText)findViewById(R.id.et2); EditText et3 = (EditText)findViewById(R.id.et3); EditText et4 = (EditText)findViewById(R.id.et4); RadioGroup rg = (RadioGroup)findViewById(R.id.rb); int sel = rg.getCheckedRadioButtonId(); RadioButton rb = (RadioButton)findViewById(sel); CheckBox ck = (CheckBox)findViewById(R.id.saving); String name = et1.getText().toString(); String accno = et2.getText().toString(); String branch = et3.getText().toString(); int bal = Integer.parseInt(et4.getText().toString()); String gender = rb.getText().toString(); String acc = ""; if(!ck.isChecked()){ acc = "Savings"; }else{ acc="Current"; } Intent in = new Intent(this,SecondActivity.class); in.putExtra("name",name); in.putExtra("accno",accno); in.putExtra("branch",branch); in.putExtra("balance",bal); in.putExtra("gender",gender); in.putExtra("account",acc); startActivity(in);
Image of page 2
} } xml: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="" xmlns:app="" xmlns:tools="" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <TableLayout android:id="@+id/tableLayout" android:layout_width="0dp" android:layout_height="wrap_content" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> <TableRow android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_width="160dp" android:layout_height="38dp" android:text="Name :"
Image of page 3
Image of page 4

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture