Question
Write a program for a bank to compare home loan applicants. Your program will enter the details of many applicants, and then write all the
Write a program for a bank to compare home loan applicants. Your program will enter the details of many applicants, and then write all the details into the document using Python.
Input In real life, you might use a form for entering data, but for the sake of this question, please use the input function.
For each applicant record being considered the user of your software needs to enter the following fields in order:
lastName: the surname of the applicant.
firstName: the given name of the applicant.
loanValue: the amount of loan requested.
assetsNet: total assets claimed by the applicant minus the value of any outstanding loans.
monthlyIncome: the monthly income of the applicant.
Input is terminated using the last name of "ZZZ". Validation as part of the Input Use the strip() method of a string to discard leading and trailing spaces from all fields. In case of input errors, you will issue an error message and input again. You will need to validate the following input fields: lastName and firstName, need to be non-empty strings. loanValue, assetsNet and monthlyIncome must be valid positive currency values. See isValidCurrency() below. Please complete the following function. It takes a single string argument and return a boolean value of true if the argument is a valid currency and return false otherwise: isValidCurrency() # Is the argument a valid currency amount, e.g. # aa = isValidCurrency("fred"); # aa will get the value false. The danger coefficient is calculated according to the following expression:- ((loanValue - assetsNet) / monthlyIncome) Output The output is generated using the print function and using a blank line to separate records. The danger co-efficient should be printed as part of the record. A given student record may appear as follows: danger coeff: 5.0 first name: Fred last name: Bloggs loan value: 256000.00 net assets: 56000.00 monthly income: 40000.00
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