Question
Write a java program (LoanApprovalLetters.java) that generates personalized emails for the loan applicants using their account information. You are given two text files applicants.txt and
Write a java program (LoanApprovalLetters.java) that generates personalized emails for the loan applicants using their account information. You are given two text files applicants.txt and template.txt. 1. applicants.txt contains the applicants UserID (a 4-digit number), name, loan amount, and the applicants credit score, each column separated by a tab. 2. template.txt contains the template of the letter that we want to personalize for each applicant. You will find the following tags in the letter content: >, >, >, and >. These tags are the placeholders for the applicants name, loan amount they requested, interest rate at which they will get the loan, and the estimated monthly payment they will make. Write a program that reads the two given files and generates letters (one letter for each applicant) with the > and > placeholders replaced by the corresponding values from the applicants.txt file. The other two placeholders will be replaced according to the following rules: - If the applicants credit score is less than 701, then the interest rate is 4.15% and the monthly payment (in dollars) would be calculated using the formula loan amount*0.00486. - If the applicants credit score is greater than 700, then the interest rate is 3.05% and the monthly payment (in dollars) would be calculated using the formula loan amount*0.00424. Save each personalized letter as a separate file with the following naming convention Letterxx_UserID.txt, where xx is the serial number (01, 02, 03, ) and UserID is the user ID of the applicant for whom the personalized email is being generated. For example, Letter01_5482.txt, Letter02_2818.txt, etc. The content of Letter01_5482.txt is given here as a sample Dear Catheryn, As a valued customer of Dreams Credit Union, you have been pre-approved for a home loan. Here are the loan-approval details - Loan Amount: 450000 Interest Rate: 4.15% Loan Term: 30-year Estimated Monthly Payment: $2187.0 Visit your local branch to learn more about this pre-approval. Thank you for being a loyal customer. Sincerely, Sarah Miller Branch Manager Dreams Credit Union
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started