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.
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.
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.
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.
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: