Question

In: Computer Science

IN ANDROID STUDIO, you will create a mortgage calculator appthat allows the user to enter...

IN ANDROID STUDIO, you will create a mortgage calculator app that allows the user to enter a purchase price, down-payment amount, and an interest rate.

  1. Based on these values, the app should calculate the loan amount (purchase price minus down payment) and display the monthly payment for 10, 20, and 30-year loans.

  2. Allow the user to select a custom loan duration (in years) by using a SeekBar and display the monthly payment for that custom loan duration.

Assignment deliverables (all in a ZIP file):

  1. A screenshot showing the execution of your application.

  2. A detailed overview of the steps taken to complete your application.

  3. The Project folder containing all source code for your application.

Solutions

Expert Solution

 MainActivity.java
 package com.example.loancalculator;  import androidx.appcompat.app.AppCompatActivity;  import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.SeekBar; import android.widget.Toast;  public class MainActivity extends AppCompatActivity { Button btncalculate,btnreset;   @Override  protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);  setContentView(R.layout.activity_main);  btncalculate =(Button) findViewById(R.id.btncalculate);  btncalculate.setOnClickListener(new View.OnClickListener() { @Override  public void onClick(View v) { EditText txtpurchaseAmmount=(EditText) findViewById(R.id.txtpurchaseAmmount);  EditText txtintrest=(EditText) findViewById(R.id.txtintrest);  EditText txtdownPayment=(EditText) findViewById(R.id.txtdownPayment);  EditText txttotal=(EditText) findViewById(R.id.txttotal);  SeekBar SeekMonth = (SeekBar) findViewById(R.id.yearseekBar);   int purchaseAmount=Integer.parseInt(txtpurchaseAmmount.getText().toString());  int downPayment=Integer.parseInt(txtdownPayment.getText().toString());   int rate=Integer.parseInt(txtintrest.getText().toString());  int period=SeekMonth.getProgress(); // here we calculate ammount   Toast.makeText(getApplicationContext(),Integer.toString(period)+" Years you Select",Toast.LENGTH_LONG).show();   int totalpay=purchaseAmount+((purchaseAmount*rate*(period/12))/100);  int monthlypay=(downPayment-(totalpay/12))/period;  txttotal.setText(Integer.toString(monthlypay)+" in years "+Integer.toString(period));  } });  btnreset =(Button) findViewById(R.id.btnreset);  btnreset.setOnClickListener(new View.OnClickListener() { @Override  public void onClick(View v) { EditText txtpurchaseAmmount=(EditText) findViewById(R.id.txtpurchaseAmmount);  EditText txtintrest=(EditText) findViewById(R.id.txtintrest);  EditText txtdownPayment=(EditText) findViewById(R.id.txtdownPayment);  EditText txttotal=(EditText) findViewById(R.id.txttotal);  txtintrest.setText("");  txtpurchaseAmmount.setText("");  txtdownPayment.setText("");  txttotal.setText("");   } });  } } 

--------------------------------------------------------------------------------------------------------------------

activity_main.xml

 xml version="1.0" encoding="utf-8"?> 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="#FFFFFF"  tools:context=".MainActivity">    android:id="@+id/txttop2"  android:layout_width="401dp"  android:layout_height="64dp"  android:layout_marginBottom="4dp"  android:layout_x="25dp"  android:layout_y="26dp"  android:background="#00F5F3F3"  android:text="Loan Calculator !"  android:textColor="#0A0A0A"  android:textSize="40sp"  app:fontFamily="sans-serif-medium" />    android:id="@+id/txttop"  android:layout_width="182dp"  android:layout_height="64dp"  android:layout_marginBottom="4dp"  android:layout_x="31dp"  android:layout_y="556dp"  android:background="#00F5F3F3"  android:text="Monthly Pay :"  android:textColor="#0A0A0A"  android:textSize="25sp"  app:fontFamily="sans-serif-medium" />   

-----------------------------------------------------------------------------------------------------------

output Screen Shot

 

Related Solutions

Android Studio. Java. Please create an application that -> An activity that allows user to enter...
Android Studio. Java. Please create an application that -> An activity that allows user to enter name, gender, date of birth, state of residence (selected from a pre-defined list: CA, AZ, NV, OR), email address and favorite website. This activity has a button "Show Data" that displays detail entered
Fat Percentage Calculator Create a C++ program that allows the user to enter the number of...
Fat Percentage Calculator Create a C++ program that allows the user to enter the number of calories and fat grams in a food. The application should display the percentage of the calories that come from fat. If the calories from fat are less than 30% of the total calories of the food, it should also display a message indicating the food is low in fat. One gram of fat has 9 calories, so: Calories from fat = fat grams *...
Show: Create an application that allows the user to enter the number of calories and fat...
Show: Create an application that allows the user to enter the number of calories and fat grams in a food. The application should display the percentage of the calories that come from fat. If the calories from fat are less than 30% of the total calories of the food, it should also display a message indicating the food is low in fat. One gram of fat has 9 calories, so: Calories from fat = fat grams *9 The percentage of...
Using Visual Studio write a program that allows the user to enter multiple scores ranging from...
Using Visual Studio write a program that allows the user to enter multiple scores ranging from 0 to 100, computes the average of those scores and then writes out a letter grade using the typical grading scale. Your program will also: 1. Allow the user to enter any number of scores he or she wishes but assume there will be at least one score entered. 2. Use a sentinel-controlled loop variable to terminate the loop when the user has no...
Time Calculator Create a C++ program that lets the user enter a number of seconds and...
Time Calculator Create a C++ program that lets the user enter a number of seconds and produces output according to the following criteria: • There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds. • There are 3,600 seconds in an hour. If the number of seconds entered by the user is greater than or...
Create a Scorekeeper app in android studio by using java language - Layouts | Widgets Create...
Create a Scorekeeper app in android studio by using java language - Layouts | Widgets Create the layout for your score keeping app. The app should have: Two team names (TextViews) Two scores (TextViews) Buttons to increase/ decrease the scores An amount to change the score by (RadioButtons) You must have at least two score options The scores can be changed by anything you want American football: 1, 2, 3, 6 Basketball: 1, 2, 3 Freestyle wrestling: 1, 2, 3,...
the code base you will be working with involves an Android application. (Android Studio) application name...
the code base you will be working with involves an Android application. (Android Studio) application name " SharingApp" In the application’s current state: A user of the app is able to create and edit a profile with a unique username and an email address. A user of the app is able to login and logout. An owner is able to record the items they own and wish to share. A bidder is able to place bids on items they wish...
Android Studio Code: Provide a working android studio code i.e java and xml code for the...
Android Studio Code: Provide a working android studio code i.e java and xml code for the activity below: Develop an application that is capable to turn pages back and forth. Detailed Instructions: For the main activity, create a layout that represents a fictitious title and author. The activity should include a clickable button on the bottom right that allows you to go forward to the next activity. The next activity will simply be an image above simple text that can...
I am doing a 4 function calculator app in java on android studio which calculates math...
I am doing a 4 function calculator app in java on android studio which calculates math expressions (add, subtract, multiply, and divide). I ONLY NEED THE CODE THE EQUAL BUTTON. When the user clicks the equal button, it should take the entire sequence of numbers and operators on the screen, such as 1+2*5 , and save them into a String [I am pretty sure this can be done using the toString() call]. Then, the String should be split using StringTokenizer,...
Write a program that runs on SPIM that allows the user to enter the number of...
Write a program that runs on SPIM that allows the user to enter the number of hours, minutes and seconds and then prints out the total time in seconds. Name the source code file “seconds.asm
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT