Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop a Java application that computes monthly payment for a car loan based on the credit score, loan amount, and loan term in months. The

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Develop a Java application that computes monthly payment for a car loan based on the credit score, loan amount, and loan term in months. The interest rates are loaded from the file that corresponds to a credit score rating. The program will read the file, and display all available credit score classifications and terms in months in the combo boxes for user to select. Refer to the video demo and program demo on how the application must + Programming Requirements The program needs to follow model-view-controller design pattern (MVC) and contain the following classes 1. LoanTerm- the class that represents the loan term data in the file (Model) 2. Ul LoanCalc-is the graphical user interface to obtain user input and display the output (View) 3. Calculator-logic to calculate the result- car loan monthly payment (Controller) 4. Program- runner class that sets the visibility of the user form. LoanTerm class LoanTerm class is the class that models a single piece of data in the file. As it is obvious from the layout, there need to be three attributes (four attributes for the bonus point feature) 1. score-located in the first column 2. interest- located in columns 2-7 months (loan duration in months)-located in the header Data file layout Credit Score/Loan Term In months12 Excellent (750-850 Good (700-749 Fair (640-699 Poor (639 or less 0.00% 0.00% 0.49% 0.99% 0.00% 0.49% 0.99% 1.49% 36 0.49% 099% 1.49% 1.99% 48 0.99% 1.49% 1.99% 2.49% 60 1.49% 1.99% 2.49% 2.90% 72 1.99% 2.49% 2.90% 3.49% UI_LoanCalc has the following features: On form load o Hide all the error labels o Set the default file path to the data file and display the path in the corresponding text-box o Instantiate "Calculator object Display the status of reading of the file Populate "Credit Score" combo-box with the values from "Calculator" object Populate "Loan Term" combo-box with the values from "Calculator" object o o Perform loan amount validation (allow dollar sign and comma) Perform required field validation on "Credit Score" and "Load Term" combo-box Provide functionality to load a new file into "Calculator" object When "LOAD" button is clicked, the file path value is obtained from the corresponding text-box A new "Calculator" object is instantiated with the new file path o o All combo-boxes are repopulated with new values from the new file o Result label is hidden (if was visible Display the results Notes On the form load, the default file needs to be read and combo-boxes prepopulated so that the form is ready to calculate the monthly payment, this means, that default file path needs to be hard-coded into your application (a good approach would be to use constant to store the default file path). The logic that is executed after "LOAD" button is clicked is the same logic that is executed on the form load read file and display status, populate combo-boxes, and hide result label; this is why, it is better to place this logic in a separate method ("instantiateCalculator(String sFile) "7 and then invoke the method twice: on the form load and on "LOAD" button clicked When "Calculate" button is clicked, input field validation needs to be performed and only if the validation passes, the "Calculator object should be instantiated (monthly payment should be calculated) and the result is displayed. If the validation fails then appropriate error message should be displayed. Calculator class Calculator class is your controller class that contains all the business logic: Read the file and extract all the needed data from the file o Hydrate the model with the data: ArrayList of LoanTerms (see the image below) Provide a method to return the list of distinct loan terms in months to be used by the view (UI From) Provide a method to return the list of distinct credit ratings to be used by the view (UI From) Provide a method to return minimum loan amount (use 1000 literal; bonus, get it from file) Provide a method to return maximum loan amount (use 100000 literal; bonus, get it from file Carry out the calculation of monthly payment o Define a method that finds the correct interest rate based on credit score and months o Calculate the monthly payment Return the result in the form of a string with the formatted details of the loan (toString) method) Provide "status" and "errorDescription" attributes to be used by the view (Ul_Form) to get error message related to reading file and other logic. If there is an error then Boolean variable status needs to be set to false and errorDescription needs to have the user-friendly description of the error to be used on the view Features Calculator class logic to calculate the loan terms and display the result Attributes, getters, setters, constructors Method that reads the file and creates ArrayList of terms Method that returns distinct list of months to populate combo-box Method that returns a distinct list of credit score ratings to populate combo-box Method to get the interest rate based on months and credit score Method to accurately calculate the monthly payment Methods to get the minimum and maximum loan amount allowed toString) method that returns results to display to the user Terms class represents loan terms from the file Constructor, getters, setters Ul LoanCalculator class-graphical user interface for users to interact with the program All required controls nicely styled and placed: labels, text boxes, combo-boxes, button, image Method that instantiates the Calculator object and returns file status. Load default file on form load Populate credit score combo-box Populate month score combo-box Validate amount: required validation, min & max validation; allow $-sign and comma Validate month & credit score combo-boxes on action performed Any input change hides the result label Exit button File/Exit Develop a Java application that computes monthly payment for a car loan based on the credit score, loan amount, and loan term in months. The interest rates are loaded from the file that corresponds to a credit score rating. The program will read the file, and display all available credit score classifications and terms in months in the combo boxes for user to select. Refer to the video demo and program demo on how the application must + Programming Requirements The program needs to follow model-view-controller design pattern (MVC) and contain the following classes 1. LoanTerm- the class that represents the loan term data in the file (Model) 2. Ul LoanCalc-is the graphical user interface to obtain user input and display the output (View) 3. Calculator-logic to calculate the result- car loan monthly payment (Controller) 4. Program- runner class that sets the visibility of the user form. LoanTerm class LoanTerm class is the class that models a single piece of data in the file. As it is obvious from the layout, there need to be three attributes (four attributes for the bonus point feature) 1. score-located in the first column 2. interest- located in columns 2-7 months (loan duration in months)-located in the header Data file layout Credit Score/Loan Term In months12 Excellent (750-850 Good (700-749 Fair (640-699 Poor (639 or less 0.00% 0.00% 0.49% 0.99% 0.00% 0.49% 0.99% 1.49% 36 0.49% 099% 1.49% 1.99% 48 0.99% 1.49% 1.99% 2.49% 60 1.49% 1.99% 2.49% 2.90% 72 1.99% 2.49% 2.90% 3.49% UI_LoanCalc has the following features: On form load o Hide all the error labels o Set the default file path to the data file and display the path in the corresponding text-box o Instantiate "Calculator object Display the status of reading of the file Populate "Credit Score" combo-box with the values from "Calculator" object Populate "Loan Term" combo-box with the values from "Calculator" object o o Perform loan amount validation (allow dollar sign and comma) Perform required field validation on "Credit Score" and "Load Term" combo-box Provide functionality to load a new file into "Calculator" object When "LOAD" button is clicked, the file path value is obtained from the corresponding text-box A new "Calculator" object is instantiated with the new file path o o All combo-boxes are repopulated with new values from the new file o Result label is hidden (if was visible Display the results Notes On the form load, the default file needs to be read and combo-boxes prepopulated so that the form is ready to calculate the monthly payment, this means, that default file path needs to be hard-coded into your application (a good approach would be to use constant to store the default file path). The logic that is executed after "LOAD" button is clicked is the same logic that is executed on the form load read file and display status, populate combo-boxes, and hide result label; this is why, it is better to place this logic in a separate method ("instantiateCalculator(String sFile) "7 and then invoke the method twice: on the form load and on "LOAD" button clicked When "Calculate" button is clicked, input field validation needs to be performed and only if the validation passes, the "Calculator object should be instantiated (monthly payment should be calculated) and the result is displayed. If the validation fails then appropriate error message should be displayed. Calculator class Calculator class is your controller class that contains all the business logic: Read the file and extract all the needed data from the file o Hydrate the model with the data: ArrayList of LoanTerms (see the image below) Provide a method to return the list of distinct loan terms in months to be used by the view (UI From) Provide a method to return the list of distinct credit ratings to be used by the view (UI From) Provide a method to return minimum loan amount (use 1000 literal; bonus, get it from file) Provide a method to return maximum loan amount (use 100000 literal; bonus, get it from file Carry out the calculation of monthly payment o Define a method that finds the correct interest rate based on credit score and months o Calculate the monthly payment Return the result in the form of a string with the formatted details of the loan (toString) method) Provide "status" and "errorDescription" attributes to be used by the view (Ul_Form) to get error message related to reading file and other logic. If there is an error then Boolean variable status needs to be set to false and errorDescription needs to have the user-friendly description of the error to be used on the view Features Calculator class logic to calculate the loan terms and display the result Attributes, getters, setters, constructors Method that reads the file and creates ArrayList of terms Method that returns distinct list of months to populate combo-box Method that returns a distinct list of credit score ratings to populate combo-box Method to get the interest rate based on months and credit score Method to accurately calculate the monthly payment Methods to get the minimum and maximum loan amount allowed toString) method that returns results to display to the user Terms class represents loan terms from the file Constructor, getters, setters Ul LoanCalculator class-graphical user interface for users to interact with the program All required controls nicely styled and placed: labels, text boxes, combo-boxes, button, image Method that instantiates the Calculator object and returns file status. Load default file on form load Populate credit score combo-box Populate month score combo-box Validate amount: required validation, min & max validation; allow $-sign and comma Validate month & credit score combo-boxes on action performed Any input change hides the result label Exit button File/Exit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions