Question: Standard ASP.NET Web Server Controls- ASP.NET C# Step One Start Visual Studio and create a new ASP.NET project --> Web --> Web Site Create ASP.NET

Standard ASP.NET Web Server Controls- ASP.NET C#

Step One

  • Start Visual Studio and create a new ASP.NET project --> Web --> Web Site
  • Create ASP.NET Empty Web Site
  • Solution name: yourFirstName_yourLastName
  • Name:Lab2
  • Add a new Web Form item

Develop a user-interface prototype

Default Values - Set the following values in your ASP.NET code

Default loan amount is the empty string Default interest rate is 7% Default time period is 20 years. Provide time periods of 10, 15, and 20 years in the drop-down box 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

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

This concludes the lab requirements.

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!