Question
Lab 1 requires that you use simple HTML and standard ASP.NET web server controls to construct an interactive interest calculator. Step 1 start up Visual
Lab 1 requires that you use simple HTML and standard ASP.NET web server controls to construct an interactive interest calculator.
Step 1
start up Visual Studio and create a new ASP.NET
Empty
Web Site named yourFirstName_LastName_lab1
Add a new Web Form item to the page named Default.aspx
Convert div tag in form to section tag
Develop a user-interface prototype
Default Values - Set the following values declaratively in your ASP.NET code
1.Default loan amount is the empty string
2.Default interest rate is 7%
3.Default time period is 20 years. Provide time periods of 10, 15, and 20 years in the drop-down box
Provide Access Keys for the Web controls Note: Access keys are illustrated with an underline in the UI prototype shown at the right. You do notneed to style your text to indicate the access keys.
ACCESS+C for the Calculate Interest button
ACCESS+R for the Reset Button
Other access keys are indicated with underlines
Conduct User Acceptance Testing
Acceptance testing is done by the user or client to verify that software meets customer's needs (as opposed to software that is bug-free but does not accomplish what the user needs done). User interface prototypes are an important intermediate step in acceptance testing.
User-interface prototypes (both paper and software) are developed to show to the client and get their acceptance early in the development process before spending much time writing code to implement functionality. Mistakes found early are much cheaper to fix than mistakes found later in development.
Typically an acceptance checklist will be prepared in advance to guide the user through a series of tests.
User Interface Acceptance Testing
Default values are correct (empty loan amount, 7%, 20 years)
Loan Amount accepts all user input
Interest Rate accepts mutually exclusive selections of 5%, 6%, or 7%
Number of years allows selection of 10, 15, or 20 years
All fields are accessible through access keys
Tab sequence through fields is in logical order
Labels associated with corresponding control
Step 2
Write Button Click Event Handler Methods
Write an event handler for the Calculate Interest button to calculate the simple interest accrued based on the following formula:
calculatedInterest = loanAmount * interestRate * numberOfYears;
Display the calculated interest in an asp:Label underneath the fieldset and formatted as follows:
Test case 1: Loan amount is 100 at 7% interest for 20 years.
Total interest for a loan of $100.00 at 7% interest for 20 years is $140.00
Test case 2: Loan amount is 12.11 at 5% interest for 10 years.
Total interest for a loan of $12.11 at 5% interest for 10 years is $6.06
Tips
The Convert class methods can be used convert legal strings to numeric values. For example:
double loanAmount = Convert.ToDouble(LoanAmountTextBox.Text);
The String.Format method using format strings is the easiest way to produce the output. See String Formatting in C# for an explanation of the formatting specifiers.
String output = String.Format("Total interest for a loan of {0:C} at {1:0%} interest for {2} years is {3:c}", loanAmount, interestRate, numberOfYears, interest);
Implement the event handler for the Reset button to set all controls back to their default values and clear the calculated interest output (if any).
Verify that your ACCESS+R access key works to invoke the Reset button.
This concludes the lab requirements.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started