App Specs: Create an Android app that computes a monthly
payment for a loan. The inputs are the principal, monthly interest rate, and the
term of the loan in years. Use LinearLayout for the
layout, a TextView widget to display the monthly payment,
and EditText widgets for the inputs.
set the EditText
widgets for inputing the principal and interest rate to accept only numbers.
Put the LinearLayout in a ScrollView
to make the app easier to use. Use a
Button widget with an event handler to perform the monthly payment
computation. Set attributes in the layout and widgets
to set the positions and colors. Set the title of the app in the
strings.xml file to be different
than Proj2Smith.
Use a radiobutton group or a spinner to set the number of years for the
loan. The choices are 10, 15, or 30 years.
Important: do not set the onClick attribute of the button to attach the click
event listener to the button (Method 1), use a lambda function (Method 4) to implement the event listener, then use
button1.setOnClickHandler to attach the event handler. A
lambda function is a function defined in arrow notation using the thin arrow
->.
Formula:
m
=
p r / 1200.0
1 - (1.0 + r / 1200.0)
12 n
where m = monthly payment, p = principal, r = interest rate percentage, n = term
of the loan in years.
Deliverable: Zip file of Android Project. Use Android
Studio to create zipfile.
Grading Breakdown: Functionality: 55%; Layout and
colors, including textview labels for edittext widgets:
10%; Colors and strings in resource files: 5%; Uses Method 3 or Method 4 to
implement button event handler: 10%; Source code comments: 10%; Source
code headers: 5%; Zipfile created with Android Studio: 5%; Properly Submitted
(app name Proj2Smith): 5%.