Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 235 Vote(s) - 3.62 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple value array

#1
I am new to jScript and have written this code [which works perfectly]. Its purpose is to test that the term for the amount of loan is not exceeded. Can the process be consolidated into one array where you pass the loan amount which returns the term based on the range i.e. 6000 to 7000 = 96



function TestMaxTerm()
{
var LnAmt = 14000 //Testing Purposes
var Term = 0 //Testing Purposes

if (LnAmt > 0 && LnAmt <= 1000){Term = 0;}
if (LnAmt > 1000 && LnAmt <= 2000){Term = 1;}
if (LnAmt > 2000 && LnAmt <= 3000){Term = 2;}
if (LnAmt > 3000 && LnAmt <= 4000){Term = 3;}
if (LnAmt > 4000 && LnAmt <= 5000){Term = 4;}
if (LnAmt > 5000 && LnAmt <= 6000){Term = 5;}
if (LnAmt > 6000 && LnAmt <= 7000){Term = 6;}
if (LnAmt > 7000 && LnAmt <= 8000){Term = 7;}
if (LnAmt > 8000 && LnAmt <= 9000){Term = 8;}
if (LnAmt > 9000 && LnAmt <= 10000){Term = 9;}
if (LnAmt > 10000 && LnAmt <= 11000){Term = 10;}
if (LnAmt > 11000 && LnAmt <= 12000){Term = 11;}
if (LnAmt > 11000){Term = 12;}


//Obtain Maximum Term for Loan Amount
var MaxTerm = new Array();
MaxTerm[0] = 24; MaxTerm[1]=36; MaxTerm[2] = 48; MaxTerm[3] = 60;
MaxTerm[5] = 72; MaxTerm[5]=84; MaxTerm[6] = 96; MaxTerm[7] = 108;
MaxTerm[8] = 120; MaxTerm[9]=132; MaxTerm[10] = 164; MaxTerm[11] = 176;
MaxTerm[12] = 420;


var text = MaxTerm[Term];
alert(text);
}

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through