ASU ISBA 2033 Programming Fundamentals    Flag Francais (.2 kB) Zhong guo qi zi (.2 kB)
Home | Syllabus | Homework | ISBA Department

Assignment Due 2023-05-16

  1. If you haven't already done so, complete the homework assigned previously.
     
  2. Write a Python app that determines the compounded amount of an investment over a ten year period, where the initial investment accrues interest annually and that interest is added to the total investment amount. Then consider a range of annual interest rates, entered as integers and starting at a value provided by the end-user, ending with a value provided by the end-user, and incrementing at a step value provided by the end-user. In addition, the end-user is to be prompted for an initial investment amount. The app is to display a one-dimensional table showing the compounded investment amount for each of the interest rates as as specified by the end-user. The coding for this app involves a repetition construct, as well as possibly one or more selection constructs. The app is to have two versions, both identical in their interfaces, calculations, and interactons with the end-user. The versions differ only in the type of repetition construct used: a while() loop, and a for() loop using the range() function (which together are essentially considered a foreach() construct in other languages), corresponding respectively with Versions A and B. FYI, the formula for compounded future value of an investment of amount P is P×(1 + i)n, where i is the interest rate and n is the number of years in the compounding term. Use a formatted print(), i.e., a print(f'...'), function to display the results.



    Recommended names for the code files are invAnalysisApp2023a and invAnalysisApp2023b, and recommended names for the variables and named constants are as follows.
  3. Enhance the Investment Analysis app described above so that the outputs are displayed in a two dimensional table, and the inputs include minimum, maximum, and step values for the investment term. However, use only the for() coding for the repetition construct.



    The recommended name for the code file is invAnalysisApp2023c, and, in addition to the above names, recommended names for the variables and named constants are as follows.