100% found this document useful (1 vote)
525 views9 pages

Experiment 10: Implementation of Income Tax/loan EMI Calculator and Deploy The Same On Real Devices

The document describes an experiment to implement an income tax and loan EMI calculator Android application. It includes the software and tools needed, such as Android Studio and the Android SDK. It provides details on creating a new Android project, designing the user interface with input fields and buttons in an XML layout file, and writing Java code to calculate the EMI when the user clicks a button. The code takes input from edit texts for principal, time period, and interest rate and displays the calculated EMI amount in a text view. The experiment aims to help students learn how to develop such a mobile application and deploy it on real devices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
525 views9 pages

Experiment 10: Implementation of Income Tax/loan EMI Calculator and Deploy The Same On Real Devices

The document describes an experiment to implement an income tax and loan EMI calculator Android application. It includes the software and tools needed, such as Android Studio and the Android SDK. It provides details on creating a new Android project, designing the user interface with input fields and buttons in an XML layout file, and writing Java code to calculate the EMI when the user clicks a button. The code takes input from edit texts for principal, time period, and interest rate and displays the calculated EMI amount in a text view. The experiment aims to help students learn how to develop such a mobile application and deploy it on real devices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Experiment 10: Implementation of income tax/loan EMI

calculator and deploy the same on real devices


PART A

Aim: To Implementation of income tax/loan EMI calculator and deploy the same on real
devices

Outcome:

After successful completion of this experiment students will be able to


Implementation of income tax/loan EMI calculator and deploy the same on real devices

Theory:

SOFTWARE:
• Android Studio
• The Android SDK (Starter Package)
• Gradle
• Java Development Kit (JDK) 5

DESCRIPTION:

1. Open android studio and select new android project .


2. Give project name and select next
3. Choose the android version.
4. Enter the package name. package name must be two word separated by comma and
click finish
5. Go to package explorer in the left hand side and select our project.
6. Go to res folder and select layout. Double click the main.xml file
7. Now you can see the Graphics layout window.
activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#D8D0D0"
tools:context=".MainActivity">

<EditText
android:id="@+id/editText"
[Type the document title] [Year]
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="@string/enter_principle"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.45"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.203"
android:autofillHints="" />

<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:hint="@string/enter_time"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.45"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.274"
android:autofillHints="" />

<EditText
android:id="@+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:hint="@string/enter_rate_of_interest"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.45"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.386"
android:autofillHints="" />

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="@string/calculate_emi"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.62" />

Computer Engineering Department


[Type the document title] [Year]
<TextView
android:id="@+id/textView"
android:layout_width="95dp"
android:layout_height="104dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.486"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.901" />
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java

package com.example.emicalculator;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {


Button calculate;
TextView result;
EditText pe, ne, re;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

calculate = findViewById(R.id.button);
result = findViewById(R.id.textView);
pe = findViewById(R.id.editText);
ne = findViewById(R.id.editText2);
re = findViewById(R.id.editText3);
calculate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Double p = Double.parseDouble(pe.getText().toString());
Double n = Double.parseDouble(ne.getText().toString());
Double r = Double.parseDouble(re.getText().toString());
Double rate= (r/1200);
Double res = (p * rate * Math.pow(1 + rate, n) / Math.pow(1 + rate, n) - 1);
result.setText("EMI = "+String.valueOf(res));
}
});
}
}

Output

Computer Engineering Department


[Type the document title] [Year]

PART B
(PART B: TO BE COMPLETED BY STUDENTS)

(Students must submit the soft copy as per following segments within two hours of
the practical. The soft copy must be uploaded on the Blackboard or emailed to the
concerned lab in charge faculties at the end of the practical in case the there is no
Black board access available)

Roll. No. 60 Name: Shubhankar kanoje

Class: TE A Batch:A3

Date of Date of Submission:16/3/22


Experiment:16/2/22

Grade:

B.1 Software Code written by student/steps:


activity_main.xml

<?xml version="1.0" encoding="utf-8"?>


<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"

Computer Engineering Department


[Type the document title] [Year]
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#D8D0D0"
tools:context=".MainActivity">

<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="8dp"
android:ems="10"
android:hint="string/enter_principle"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.45"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.203"
android:autofillHints="" />

<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:hint="string/enter_time"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.45"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.274"
android:autofillHints="" />

<EditText
android:id="@+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:ems="10"
android:hint="string/enter_rate_of_interest"
android:inputType="number"
app:layout_constraintBottom_toBottomOf="parent"

Computer Engineering Department


[Type the document title] [Year]
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.45"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.386"
android:autofillHints="" />

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:text="string/calculate_emi"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.62" />

<TextView
android:id="@+id/textView"
android:layout_width="95dp"
android:layout_height="104dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.486"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.901" />
</androidx.constraintlayout.widget.ConstraintLayout>

MainActivity.java

package com.example.emi_calculator;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {


Button calculate;
TextView result;
EditText pe, ne, re;

Computer Engineering Department


[Type the document title] [Year]

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

calculate = findViewById(R.id.button);
result = findViewById(R.id.textView);
pe = findViewById(R.id.editText);
ne = findViewById(R.id.editText2);
re = findViewById(R.id.editText3);
calculate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Double p = Double.parseDouble(pe.getText().toString());
Double n = Double.parseDouble(ne.getText().toString());
Double r = Double.parseDouble(re.getText().toString());
Double rate= (r/1200);
Double res = (p * rate * Math.pow(1 + rate, n) / Math.pow(1 + rate, n) - 1);
result.setText("EMI = "+String.valueOf(res));
}
});
}
}
B.2 Input and Output:
(Paste your output that you are getting after running app in from of screenshots.)

Computer Engineering Department


[Type the document title] [Year]

B.3 Observations and learning:


We learned how to implement income tax/loan EMI calculator and it on the same on real
devices. We learned how the write the java code to implement it on android phones.

B.4 Conclusion:
We successfully implemented income tax/loan EMI calculator and deployed the same on
real devices in this experiment
.
B.5 Question of Curiosity

Questions

1)Explain different steps required to build up this project?

Ans: Step 1: Open Android Studio and Start a New Android Studio Project.

Step-2: You can choose your application name and choose where your project is
stored on the location. Select java language and click the "Next" button.

Step-3 : Choose the android version.

Step 4 Enter the package name. package name must be two word separated by
comma and click finish

Computer Engineering Department


[Type the document title] [Year]

Step 5:Go to activity_main.xml. This XML file contains the designing code
for an Android app in the activity_main.xml,

Step 6:Go to Main Activity.java. This Java program is the back-end language
for Android. The Java code is given

Step 7:Now, either go to the menu bar and click "Make a project" or press
ctrl+f9 to debug the error.

Step 8:Then, click the Run button or press shift+f10 to run the project.
Select the "virtual machine" option and click OK.

Step-9: Now we can see the Graphics layout window.


We then run the .java file and open the app named emi_calculator here.
We then enter the principle,time and rate of interest and click calculate emi
button to get the output.

Computer Engineering Department

You might also like