Question
https://drive.google.com/open?id=1xrRjvKrX1Etf-PnIahqqFrtHfK9pZee_ Use the above files to solve the problem. Below is a description of the functions: main: This is the most important function, because it
https://drive.google.com/open?id=1xrRjvKrX1Etf-PnIahqqFrtHfK9pZee_
Use the above files to solve the problem.
Below is a description of the functions:
- main: This is the most important function, because it is responsible for calling your other functions in the right order. There are two strategies for writing it: A) build it up incrementally as you write the other functions, or B) write this function only after you have implemented all the other functions.
- print_introduction: This prints a brief message that greets the user. It consumes nothing and returns nothing.
- input_name: This prompts the user to type in their name and prints some messages (including the user's name). It consumes nothing, but returns the user's name as a string.
- calculate_rating: This is Grindlehook's function. Do not worry about how this function works, simply know that when its called, it returns the customer's rating as an integer. You will only be able to call it once per program's execution (afterwards it stops returning the right value). You cannot simply hardcode its value into your system, because it is different for each user. And, of course, you can't fix it because Grindlehook will get angry at you. Sadly, you will encounter Grindlehook's in many jobs, and learning to work around them is a valuable life skill.
- print_rating: This prints the user's calculated rating (the result of calling calculate_rating). It consumes an integer (representing the rating) and returns nothing.
- input_loan_amount: This prompts the user to type in their desired loan amount and prints some messages. It consumes nothing, but returns the loan amount as an integer. Remember, the input function returns a string, so you will need to convert the result using the built-in int function.
- print_loan_availability: This function consumes a rating and a loan amount, and prints whether or not a loan is available to the user by calling the test_loan function. It does not return anything.
- test_loan: This function consumes a rating and a loan amount, and returns whether or not a loan is available to the user by using the following formula: rating2 * 100 >= loan amount. Note that this function returns a boolean, and does not print anything.
- print_conclusion: This prints a brief message that thanks the user. It consumes nothing and returns nothing.
Refer to the sample_output.txt file (using your Programmer Friendly Text Editor) to see the exact messages that should be displayed for each function.
You are graded based on passing the unit tests (run the provided test_my_solution.py program). Simply eyeballing the output is insufficient. Only the unit tests can determine if you earn points. You should run the unit tests early and often as you develop. Inability to follow instructions and use the unit tests is not an excuse. You must match the expected output exactly. Refer to the sample_output.txt file for the exact text to print in each part.
Often, your program will fail to pass the unit tests. Sometimes, they will give you an Output Diff. If you are having trouble understanding the Output Diff
NOTE: I have 3 accounts and will upvote the solution, if correct, on all three. I'm also allowed to submit the code multiple times meaning if there's an error in it, I'm able to let you know to give you the opportunity to fix it. MUST be done in Python
Let me know if you need anymore information or have any questions
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