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 *...
On Android Studio, create a 4 function calculator. The only buttons you need are 0-9, *,...
On Android Studio, create a 4 function calculator. The only buttons you need are 0-9, *, /, +, -, a clear, and enter button. Use StringTokenizer or String.split for the calculator code.
On Android Studio, create a 4 function calculator. The only buttons you need are 0-9, *,...
On Android Studio, create a 4 function calculator. The only buttons you need are 0-9, *, /, +, -, a clear, and enter button. Having this java code below, I need the XML code that organizes the layout of the calculator (using either linearLayout or relativeLayout). As shown in the JAVA Code - Button button0, button1, button2, button3, button4, button5, button6, button7, button8, button9, buttonadd, buttonsubtract, buttonmultiply, buttondivide, buttonequals, buttonclear and TextView display - is what is needed in the...
Create an application that allows the user to enter the total for an order and the...
Create an application that allows the user to enter the total for an order and the name of the customer. If the order is less than 500 dollars, the customer gets no discount. If the order is greater than or equal to 500 and less than 1000 dollars, the customer gets a 5 percent discount. If the order is greater than or equal to 1000 dollars, the customer gets a 10 percent discount. The application should display the name of...
Android Studio (Java) I'm trying to create a simple calculator. I want to put out a...
Android Studio (Java) I'm trying to create a simple calculator. I want to put out a message if they try to divide by 0. I have this so far. What code should I put? divide.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (number1.getText().length() != 0 && number2.getText().length() != 0) { double n1= Double.parseDouble(number1.getText().toString()); double n2= Double.parseDouble(number2.getText().toString()); double res= n1 / n2; result.setText(String.valueOf(res)); } else { Toast.makeText(view.getContext(), "Please enter the numbers properly", Toast.LENGTH_SHORT).show(); } } });
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...
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...
Create a Python program that: Allows the user to enter a phrase or sentence. The program...
Create a Python program that: Allows the user to enter a phrase or sentence. The program should then take the phrase or sentence entered Separate out the individual words entered Each individual word should then be added to a list After all of the words have been place in a list Sort the contents of the list Display the contents of the sorted list with each individual word displayed on a separate line Display a message to the user indicating...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT