Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Standard ASP.NET Web Server Controls Lab 2 requires that you use standard ASP.NET controls to construct an interactive interest calculator. Please write this program

Use Standard ASP.NET Web Server Controls

Lab 2 requires that you use standard ASP.NET controls to construct an interactive interest calculator.

Please write this program in C# ASP.Net

Step 1

  • 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 as in the image

Default Values - Set the following values 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

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

2. What is the meaning and definition of Banking?

Answered: 1 week ago

Question

3.What are the Importance / Role of Bank in Business?

Answered: 1 week ago