Question: Unix/Lunix Programming loan_calc_interactive CODE is below: #!/bin/bash # loan_calc_interactive: calculate monthly loan-payments (interactive) PROGNAME=$(basename $0) # extract basename of the program # Display an informative

Unix/Lunix Programming

Unix/Lunix Programming loan_calc_interactive CODE is below: #!/bin/bash # loan_calc_interactive: calculate monthly loan-payments

loan_calc_interactive CODE is below:

#!/bin/bash # loan_calc_interactive: calculate monthly loan-payments (interactive) PROGNAME=$(basename $0) # extract basename of the program # Display an informative usage message when # an unknown option is attempted. usage () { # COMPLETE the echo-command: replace "..." with a proper message. echo "Usage: ... Where: -i interactive mode PRINCIPAL is the amount of the loan. INTEREST is the APR as a number (7% = 0.07). MONTHS is the length of the loan's term." } # COMPLETE the testing: replace "..." by proper checking on $# for # incorrect options if (( ... )); then usage exit 1 fi # Place-holders for principal, interest, and months. # COMPLETE the assigments: replace "..." by proper positional parameters. principal=... interest=... months=... # COMPLETE the testing: replace "..." by proper checking on $# for # interactive mode. if (( ... )); then # COMPLETE the commands to prompt user and read in principal, # interest, and months: replace ... with proper commands # for prompting and reading. ... ... ... fi # Invoke calculator bc to compute monthly loan payment. bc Exercise 7 [ The code-skeleton of the script loan_calc_interactive is placed in the D2L Content. ] Add a command line option to the loan_calcinteractive to implement an interactive mode that will prompt user to input the principal, interest rate, and months. (Assume that the program is run as: either "loan calc interactive -i" or "loan calc interactive principal interest months")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!