Site Search

CS 351: Lab 1

Web Controls

Use Visual Studio 2005's text editor, XHTML elements, and Web Server Controls, and C# methods to construct the following ASP.NET interactive interest calculator.

lab 1 screen snapshot 1

Getting Started

Start Up Values

  1. Set the default interest rate to 7%
  2. Set the default time period to 20 years, but provide time periods of 10, 15, and 20 years
  3. Provide AccessKeys for the Web controls
    • Alt-C for the Calculate Interest button, Alt-R for the Reset Button
    • Other AccessKeys are indicated with underlines
  4. Validate your code to XHTML 1.0 Transitional

Event Handler Methods

lab 1 screen snapshot 2

Add an event handler for the Calcuate Interest button to calculate the simple interest accrued based on the following formula:

Display the calculated interest underneath the fieldset as shown on the screen snapshot.

The Reset button should set all controls back to their default values and clear the calculated interest output (if any)

Notes

The Convert class methods can be used convert strings to numeric values. For example:

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.

To Receive Credit

Lab 1 is an in-class assignment begun on Wednesday and due by the start of class on Friday

Ed Gellenbeck, Department of Computer Science, CWU
400 E. University Way, Ellensburg, WA 98926-7520