Goal: In this assignment youll be porting your project 6 project to have add two new content pages.

1.The original project 6 page will be the first page in the app. It will need to be updated to write the principal, interest rate, duration and monthly payment to a file each time the button is pressed. You will need to add an App_Data directory because that is where the data file will go.

2.The first new page allows the user to view the loans that have been calculated before.

3.The second new page will allow the user to delete the file used to store the calculate monthly payments

Relevant Example: Youll watch the lecture and review the notes related to master pages and AJAX to make sure you know how to this assignment. The AJAX behavior needs to remain functional. Depending on how you build your app and the nesting of things you may need to use a ScriptingManagerProxy.

Guidance:

1.You need to add a App_Data folder (Website menu>Add ASP.NET Folder>App_Data)

2.You will new to add two new content pages. The easiest way to do this is to open the masterpage and go to the website menu. There will be a choice to add a content page.

3.Youll need to use Sever.MapPath(App_Data/monthlylog.txt) to get the virtual location of the file to read and write (remember your using a web server with a virtual directory path). [covered in 5/29 lecture]

System.IO.File.AppendText is good for adding to a file (it will create it if it doesnt exist)

System.IO.File.ReadAllLines is good to read all the content from a file. It returns an array of strings (one for each line in the file). Use Foreach to load the Listbox1 by calling < Listbox name>.Items.Add

System.IO.File.Exists to see if a file exists

System.IO.File.Delete to delete a fiel

4.Youll need to add an < ASP:Menu> control to the masterpage to allow you to navigate to the new pages. [covered in 5/29 lecture]

5.You will use the listbox to display the monthly loan calculation history.

Figure 1. See image.

Figure 2. See image.

Figure 3. See image.

Detailed Specs:

Page 1

1.Input the principal, number of years, and interest rate as string variables.

2.Convert each of the variables in the preceding step to double or decimal using the double.TryParse or decimal.TryParse method. Prompt the user to reenter any illegal input.

3.Compute the monthly payment using this formula: See image.

4.p = principal (dollars), n = number of years, r = interest rate (percent), m = monthly payment (dollars). Use the .Net function call Math.pow(x, y) to compute xy (x raised to the y power).

5.Output the amount of the monthly payment

6.Write the principal, interest rate, loan duration and monthly payment to a file.

Page 2

1.The first new page allows the user to view the loans that have been calculated before using a Listbox. Have a button that causes the Listbox to be loaded.

Page 3

1.The second new page will allow the user to delete the file used to store the calculated monthly payments. Have a button cause the deletion.

Hints and questions to ask yourself before handing this in:

  • Is the Window title set to something meaningful?
  • Did I break the functionality out in such a way that I would reuse part this this again. For example, the computation components or the conversion from a string component again easily (hint: like in the next assignment)?
  • Did I format the monthly payment as a proper money amount (e.g. $2.91 instead of 2.90813453)?
  • Check the output with this site http://www.bankrate.com/calculators/mortgages/loan-calculator.aspx
  • Please use these naming standards for future projects: http://blogs.msdn.com/b/mschray/archive/2013/05/06/practical-naming-standards-for-c.aspx
  • Is the output clear?
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.