Thursday, November 13, 2008

Chapter 1: Programming Challenge 1

Step 1: Clearly define what the application is to do.
Purpose: To calculate the area of a rectangular space
Input: Length and width of space
Process: Multiply the length and width
Output: Display the total area

Step 2: Visualize the application and design its user interface.


Step 3: Make a list of the controls needed.
TypeName Text
Form (default) “Carpet Calculator”
Label (default) “Length”
Label (default) “Width”
Label (default) “Total Area”
TextboxtxtLength “ “
TextboxtxtWidth “ “
TextboxtxtTotalArea“ “
Button btnCalcArea “Calculate”
Button btnClear “Clear”
Button btnClose “Close"
Step 5: Make a list of methods needed for each control.
MethodDescription
btnCalcArea_ClickMultiplies txtLength and txtWidth values to find txtTotalArea
btnClear_Click Clears txtLength, txtWidth, and txtTotalArea
btnClose_Click Ends application

Step 6: Create a flowchart or pseudo code version of each method.