Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Easy Credit evaluates the credit limit of people based on their income and past

ID: 3656581 • Letter: E

Question

Easy Credit evaluates the credit limit of people based on their income and past credit limits. Based on these inputs, calculations are performed to ascertain the credit worthiness of the customer. The following is a pseudocode that will help them to automate the system of checking the credit worthiness and then printing out the results so that Easy Credit's manager can make a decision on the limit to be given to the customer: start read Customer_Name perform Calculate_SafetyLevel() perform Evaluate_History() print Customer_Name print 'Credit History of' Client_Name 'is' History print 'Safety Level of' Client_Name 'is' Safety_Level stop Calculate_SafetyLevel() read Customer_Income if Customer_Income >= $5000 Safety_Level = Excellent elseif Customer_Income >= $3000 Safety_Level = Good elseif Customer_Income >= $1500 Safety_Level = Ok endif return Evaluate_History() read Customer_History if Customer_History = Clean History = Good elseif Customer_History = Pending_Balance History = OK elseif Customer_History = Defaulted History = Risky endif return optimize the above pseudocode to make it more efficient.

Explanation / Answer

what do you mean more efficient? The code looks optimal for what you want it to do.... Depending on the language, turning the if-else structures into switch structures may make the code slightly more efficient. Perhaps the one thing you could do is to store the income and the history, so that you can recall them in constant time, instead of the O(something) it would normally take.It's good though to give a description of each procedure, because if (for example) the history and encome is read in constant time, the above "correction" instead of making your code better, would make it use more memory than needed.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote