main: This is the most important function, because it is responsible for calling your other functions in
Fantastic news! We've Found the answer you've been seeking!
Question:
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.
printintroduction: This prints a brief message that greets the user. It consumes nothing and returns nothing.
inputname: 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.
calculaterating: 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.
printrating: This prints the user's calculated rating the result of calling calculaterating It consumes an integer representing the rating and returns nothing.
inputloanamount: 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 builtin int function.
printloanavailability: This function consumes a rating and a loan amount in this order and prints whether or not a loan is available to the user by calling the testloan function. It does not return anything.
testloan: This function consumes a rating and a loan amount in this order and returns whether or not a loan is available to the user by using the following formula: rating loan amount. Note that this function returns a boolean, and does not print anything.
printconclusion: This prints a brief message that thanks the user. It consumes nothing and returns nothing.
Related Book For
Management A Practical Introduction
ISBN: 978-0078112713
5th edition
Authors: Angelo Kinicki, Brian Williams
Posted Date: