You are on page 1of 3

Carpet Size

You have been asked to create an application for a carpet sales and installation business. The
application should allow the user to enter the length and width of a room and calculate the
room’s area in square feet. The formula for this calculation is:
Area=Length×Width

1 Clearly define what the application is to do:


Purpose: Create an application that will calculate the room’s area in square feet.
Input: Enter length and width of a room.
Process: Multiply width and length of a room. The result should calculate the room’s area in
square feet.
Output: Display rooms area in square feet.

2 Visualize the application running on the computer and design its user interface:

3 Determine the controls needed & 4 Define the values of each control’s relevant
properties:

Control Type Control Name Text Property Description


Form default Area Calculator Form that helps
calculate area in
square feet and
where all controls
will be placed.
Label lblLength Enter Length Displays the length
Label lblWidth Enter Width Displays the Width
Label lblArea Area Displays the Area
Label lblRoomArea “0.0 ft” Displays the
Room’s Area after
the btnCalcArea
has been clicked
TextBox txtLength ““ Allows user to
enter room’s length
TextBox txtWidth ““ Allows user to
enter room’s Width
Button btnCalcArea “Calculate Room’s When clicked,
Area” multiplies Length
of the room by the
Width of the room;
stores the result in a
variable and
displays it in the
lblRoomArea in
square feet.
Button btnExit “Exit” When clicked,
closes/terminates
the application

5 Determine the event handlers and other code needed for each control.

Event Handler Name Description

btnCalcArea_Click Multiplies the Length and Width; these values


are retrieved from the txtLength and
txtWidthTextBox controls and the result of
the multiplication is stored in the
lblRoomArea.

btnClose_Click Terminates the application


6 Create a flowchart or pseudocode version of the code.

Start

Multiply the length of the room by Store


the width of theofroom.
the value Store the result
the dblRoomArea in the
in the dblRoomAre
lblRoomArea c

You might also like