Purchase Solution

Perl Program Update

Not what you're looking for?

Ask Custom Question

Please apply the following formula below to the program so it works correctly!

The following formula is used to calculate the fixed monthly payment (P) required to fully amortize a loan of L dollars over a term of n months at a monthly interest rate of c. [If the quoted rate is 6%, for example, c is .06/12 or .005].

P = L[c(1 + c)n]/[(1 + c)n - 1]

I am currently getting the following errors

Number found where operator expected at calc.cgi line 38, near "#P = Lr(1+r/1200"
(Might be a runaway multi-line // string starting on line 15)
(Do you need to predeclare P?)
Unquoted string "n" may clash with future reserved word at mor_calc.cgi line 38.
Unquoted string "r" may clash with future reserved word at mor_calc.cgi line 38.
Unquoted string "n" may clash with future reserved word at mor_calc.cgi line 38.
Scalar found where operator expected at mor_calc.cgi line 39, near "$num_months"
(Missing semicolon on previous line?)
syntax error at mor_calc.cgi line 38, near "P = Lr(1+r/1200"
Missing right curly or square bracket at mor_calc.cgi line 61, at end of line
Execution of calc.cgi aborted due to compilation errors.

Thank you!

Purchase this Solution

Solution Summary

The following formula is used to calculate the fixed monthly payment (P) required to fully amortize a loan of L dollars over a term of n months at a monthly interest rate of c. [If the quoted rate is 6%, for example, c is .06/12 or .005].

P = L[c(1 + c)n]/[(1 + c)n - 1]

I am currently getting the following errors

Number found where operator expected at calc.cgi line 38, near "#P = Lr(1+r/1200"
(Might be a runaway multi-line // string starting on line 15)
(Do you need to predeclare P?)
Unquoted string "n" may clash with future reserved word at mor_calc.cgi line 38.
Unquoted string "r" may clash with future reserved word at mor_calc.cgi line 38.
Unquoted string "n" may clash with future reserved word at mor_calc.cgi line 38.
Scalar found where operator expected at mor_calc.cgi line 39, near "$num_months"
(Missing semicolon on previous line?)
syntax error at mor_calc.cgi line 38, near "P = Lr(1+r/1200"
Missing right curly or square bracket at mor_calc.cgi line 61, at end of line
Execution of calc.cgi aborted due to compilation errors.

Solution Preview

Dear Student,

I have modified the script and named new_mor_cal.pl to follow the new formula given above. Please follow the following instructions on usage of this program.

usage: perl new_mor_calc.pl -L 20000 -y 15 -i 12

-L amount : Amount of loan.
-y years : Number of years
-i interest : Percent per year interest.
-h ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic Networking Questions

This quiz consists of some basic networking questions.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.