{ "key_pair_value_system": true, "answer_rating_count": "", "question_feedback_html": { "html_star": "", "html_star_feedback": "" }, "answer_average_rating_value": "", "answer_date_js": "2024-09-09T05:12:16-04:00", "answer_date": "2024-09-09 05:12:16", "is_docs_available": null, "is_excel_available": null, "is_pdf_available": null, "count_file_available": 0, "main_page": "student_question_view", "question_id": "9774645", "url": "\/study-help\/questions\/decode-php-to-javascript-product-discount-calculator-loan-calculator-loan-9774645", "question_creation_date_js": "2024-09-09T05:12:16-04:00", "question_creation_date": "Sep 09, 2024 05:12 AM", "meta_title": "[Solved] decode php to javascript Product Discount | SolutionInn", "meta_description": "Answer of - decode php to javascript Product Discount Calculator Loan Calculator Loan Amount Interest Rate (annual %) Period in ye | SolutionInn", "meta_keywords": "decode,php,javascript,product,discount,calculator,loan,amount,interest,rate,annual,period", "question_title_h1": "decode php to javascript Product Discount Calculator Loan Calculator Loan Amount Interest Rate (annual %) Period in years \/\/Here goes the answer \/\/To ensure form", "question_title": "decode php to javascript Product Discount Calculator Loan Calculator Loan Amount Interest", "question_title_for_js_snippet": "decode php to javascript Product Discount Calculator Loan Calculator Loan Amount Interest Rate (annual ) Period in years Here goes the answer To ensure form is submitted or not if(isset($ REQUEST 'submit' )) Loan amount var loanAmount $ REQUEST 'loan amount' Monthly rate var annualRate $ REQUEST 'annual rate' Months in the loan period var periodInYears $ REQUEST 'years' document write Loan amount $loanAmount document write Annual Rate $annualRate document write Years in the loan periond $periodInYears if ($loanAmount $annualRate $periodInYears) Check if these values are valid Start to do your work here Don't use operator ' ' $monthRate $annualRate 12 100 Convert years to months(periods) $numberOfPeriods $periodInYears 12 Calculating numerator of the formula i e A r $numerator $loanAmount $monthRate Calculating denominator of the formula i e (1 pow((1 r),( n))) $denominator (1 pow((1 $monthRate), ($numberOfPeriods))) Calculating Monthly Payment i e numerator denominator $payment $numerator $denominator Calculating Total Interest i e nP A $totalInterest $numberOfPeriods $payment $loanAmount document write Monthly payment is $payment document write Total Interest is $totalInterest If form not submitted don't show any values else document write Loan amount document write Annual Rate document write Years in the loan periond ", "question_description": "
decode php to javascript <\/strong><\/p> Loan Calculator <\/h1>